/* ===== STREAM PAGE STYLES ===== */

.stream-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== STREAM LAYOUT ===== */
.stream-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto 1fr;
    gap: 0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px 20px;
    width: 100%;
    flex: 1;
}

/* ===== VIDEO SECTION ===== */
.video-section {
    grid-column: 1;
    grid-row: 1 / 3;
    padding-right: 15px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
}

.video-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.video-placeholder .big-play {
    width: 80px;
    height: 80px;
    background: rgba(244, 115, 33, 0.15);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary);
    margin: 0 auto 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.video-placeholder .big-play:hover {
    background: rgba(244, 115, 33, 0.3);
    transform: scale(1.1);
}

.video-placeholder p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Video Controls Overlay */
.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 15px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-wrapper:hover .video-controls-overlay {
    opacity: 1;
}

.ctrl-btn {
    background: transparent;
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.15);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.ctrl-spacer {
    flex: 1;
}

.quality-badge {
    background: rgba(0,0,0,0.6);
    color: #00cc44;
    border: 1px solid #00cc44;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

/* Bouton enregistrement (overlay vidéo) */
.ctrl-btn-record {
    color: rgba(255,255,255,0.75);
    font-size: 16px;
    transition: color 0.2s, transform 0.15s;
}

.ctrl-btn-record:hover {
    color: #e74c3c;
    background: rgba(231,76,60,0.15);
}

.ctrl-btn-record.recording {
    color: #e74c3c;
    animation: recPulse 1.2s infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.92); }
}

/* Bouton enregistrement principal (barre streamer) */
.btn-record-main {
    background: rgba(231,76,60,0.12);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,0.35);
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-record-main:hover {
    background: rgba(231,76,60,0.25);
    border-color: #e74c3c;
    transform: translateY(-1px);
}

.btn-record-main.recording {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    animation: recPulse 1.2s infinite;
}

/* Bouton enregistrement dans le chat */
.chat-action-btn.rec-btn {
    background: rgba(231,76,60,0.1);
    color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
}

.chat-action-btn.rec-btn:hover {
    background: rgba(231,76,60,0.2);
}

.chat-action-btn.rec-btn.recording {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* ===== BADGE PRIVÉ (page d'accueil) ===== */
.badge-private {
    background: rgba(155, 89, 182, 0.85);
    color: white;
    border: 1px solid rgba(155, 89, 182, 0.6);
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ===== ANIMATION OVERLAY PRIVÉ ===== */
@keyframes privateGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 115, 33, 0);
        border-color: rgba(244, 115, 33, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 6px rgba(244, 115, 33, 0.2);
        border-color: rgba(244, 115, 33, 0.7);
    }
}

/* Live badge on video */
.video-live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
}

.video-live-badge .dot {
    width: 7px;
    height: 7px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.video-viewer-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== STREAMER INFO ===== */
.streamer-info-bar {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

.streamer-big-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    flex-shrink: 0;
}

.streamer-info-details {
    flex: 1;
    min-width: 0;
}

.streamer-info-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.verified-badge {
    color: var(--primary);
    font-size: 16px;
}

.streamer-info-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.streamer-info-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.streamer-info-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.streamer-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

.btn-follow {
    background: var(--primary);
    color: white;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-follow:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 115, 33, 0.3);
}

.btn-follow.following {
    background: var(--tag-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-tip {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-tip:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.btn-share {
    background: var(--tag-bg);
    color: var(--text-secondary);
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 15px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-share:hover {
    background: var(--tag-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ===== STREAM TAGS ===== */
.stream-tags-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stream-tag {
    background: var(--tag-bg);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.stream-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== GOAL BAR ===== */
.goal-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.goal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.goal-amount {
    font-size: 12px;
    color: var(--text-muted);
}

.goal-amount span {
    color: var(--primary);
    font-weight: 700;
}

.goal-bar {
    height: 8px;
    background: var(--tag-bg);
    border-radius: 4px;
    overflow: hidden;
}

.goal-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #f39c12);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.goal-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== RELATED STREAMS ===== */
.related-section {
    margin-top: 20px;
}

.related-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.related-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-card {
    display: flex;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.related-card:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.related-thumb {
    width: 100px;
    height: 56px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.related-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.related-viewers {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-tag {
    font-size: 11px;
    color: var(--primary);
    margin-top: 3px;
}

/* ===== CHAT SECTION ===== */
.chat-section {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    height: calc(100vh - 120px);
    position: sticky;
    top: 80px;
    overflow: hidden;
}

.chat-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-online {
    font-size: 11px;
    color: var(--online);
    font-weight: 500;
}

.chat-settings {
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.chat-settings:hover {
    background: var(--tag-bg);
    color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-message {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.chat-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    margin-top: 1px;
}

.chat-msg-content {
    flex: 1;
    min-width: 0;
}

.chat-username {
    font-size: 12px;
    font-weight: 700;
    margin-right: 5px;
}

.chat-username.mod { color: #2ecc71; }
.chat-username.vip { color: #f39c12; }
.chat-username.fan { color: #9b59b6; }
.chat-username.regular { color: var(--primary); }
.chat-username.guest { color: var(--text-muted); }

.chat-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.chat-tip-msg {
    background: linear-gradient(135deg, rgba(243,156,18,0.15), rgba(230,126,34,0.1));
    border: 1px solid rgba(243,156,18,0.3);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 4px 0;
}

.chat-tip-msg .tip-amount {
    color: #f39c12;
    font-weight: 700;
    font-size: 13px;
}

.chat-tip-msg .tip-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.system-msg {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
    font-style: italic;
}

/* Chat Input */
.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary);
}

.chat-input {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    border: none;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-emoji-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
    border: none;
    padding: 0;
}

.chat-emoji-btn:hover {
    color: var(--primary);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.chat-actions-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.chat-action-btn {
    flex: 1;
    background: var(--tag-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 7px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.chat-action-btn:hover {
    background: var(--tag-hover);
    color: var(--text-primary);
}

.chat-action-btn.tip-btn {
    background: rgba(243,156,18,0.1);
    color: #f39c12;
    border-color: rgba(243,156,18,0.3);
}

.chat-action-btn.tip-btn:hover {
    background: rgba(243,156,18,0.2);
}

/* ===== TIP MODAL ===== */
.tip-modal .modal {
    max-width: 380px;
}

.tip-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.tip-amount-btn {
    background: var(--tag-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tip-amount-btn:hover,
.tip-amount-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tip-amount-btn .token-icon {
    font-size: 12px;
    display: block;
    color: #f39c12;
    margin-bottom: 2px;
}

.tip-amount-btn.selected .token-icon {
    color: rgba(255,255,255,0.8);
}

/* ===== CHAT AMÉLIORATIONS ===== */

/* Message de l'utilisateur lui-même */
.own-message {
    background: rgba(244, 115, 33, 0.05);
    border-left: 2px solid var(--primary);
    border-radius: 0 4px 4px 0;
    padding-left: 6px;
    margin-left: -6px;
}

/* Message avec mention */
.mentioned {
    background: rgba(244, 115, 33, 0.1) !important;
    border-left: 2px solid var(--primary) !important;
    border-radius: 0 4px 4px 0;
    padding-left: 6px;
    margin-left: -6px;
    animation: mentionPulse 0.5s ease;
}

@keyframes mentionPulse {
    0% { background: rgba(244, 115, 33, 0.3); }
    100% { background: rgba(244, 115, 33, 0.1); }
}

/* Emoji picker items */
.emoji-item {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: var(--tag-hover);
    transform: scale(1.2);
}

/* Scrollbar chat */
#chatMessages::-webkit-scrollbar {
    width: 4px;
}
#chatMessages::-webkit-scrollbar-track {
    background: transparent;
}
#chatMessages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Animation entrée message */
.chat-message {
    animation: msgSlideIn 0.2s ease;
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE STREAM ===== */
@media (max-width: 1100px) {
    .stream-layout {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 900px) {
    .stream-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .video-section {
        grid-column: 1;
        grid-row: 1;
        padding-right: 0;
    }

    .chat-section {
        grid-column: 1;
        grid-row: 2;
        height: 400px;
        position: static;
    }

    .streamer-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .stream-layout {
        padding: 10px 12px;
    }

    .streamer-info-bar {
        flex-wrap: wrap;
    }

    .streamer-actions {
        width: 100%;
    }

    .btn-follow, .btn-tip {
        flex: 1;
        justify-content: center;
    }
}
