/**
 * PHANTOM TWITCHESS - Twitch Connection Styles
 * Styles pour la modal de connexion et les indicateurs
 */

/* ============================================
   STATUS DOT ANIMATIONS
   ============================================ */

.status-dot--twitch {
    transition: all 0.3s ease;
}

.status-dot--twitch.is-connecting {
    background: var(--accent-orange) !important;
    animation: pulse-connecting 1.5s infinite;
}

.status-dot--twitch.is-connected {
    background: var(--accent-green) !important;
    box-shadow: 0 0 8px var(--accent-green);
}

.status-dot--twitch.is-error {
    background: var(--accent-red) !important;
}

@keyframes pulse-connecting {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   TWITCH MODAL
   ============================================ */

.twitch-modal {
    max-width: 450px;
    overflow: visible;
}

.twitch-modal__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.twitch-modal__logo {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #9146FF, #772CE8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.modal__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   INPUT GROUP
   ============================================ */

.twitch-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.twitch-input-group:focus-within {
    border-color: #9146FF;
    box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);
}

.twitch-input-prefix {
    padding: 0 0 0 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}

.twitch-input {
    flex: 1;
    padding: 14px 12px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}

.twitch-input::placeholder {
    color: var(--text-muted);
}

.twitch-input-status {
    padding: 0 16px;
    font-size: 1.1rem;
    min-width: 40px;
    display: flex;
    justify-content: center;
}

/* ============================================
   RECENT CHANNELS
   ============================================ */

.twitch-recent {
    margin-bottom: 20px;
}

.twitch-recent__label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.twitch-recent__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.twitch-recent__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.twitch-recent__item:hover {
    background: var(--bg-card-hover);
    border-color: #9146FF;
    color: var(--text-primary);
}

.twitch-recent__item i {
    color: #9146FF;
    font-size: 0.8rem;
}

/* ============================================
   CHANNEL PREVIEW
   ============================================ */

.twitch-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.twitch-preview__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-hero);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.twitch-preview__info {
    flex: 1;
}

.twitch-preview__name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.twitch-preview__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.twitch-preview__status.is-live {
    color: var(--accent-red);
}

.twitch-preview__status.is-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.twitch-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============================================
   CONNECT BUTTON
   ============================================ */

.btn--twitch {
    background: linear-gradient(135deg, #9146FF, #772CE8);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.btn--twitch:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(145, 70, 255, 0.4);
}

.btn--twitch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--twitch i {
    margin-right: 8px;
}

/* ============================================
   NAVBAR TWITCH BUTTON (Amélioration)
   ============================================ */

.nav__twitch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav__twitch-btn:hover {
    border-color: #9146FF;
    color: var(--text-primary);
}

.nav__twitch-btn.is-connected {
    background: rgba(145, 70, 255, 0.1);
    border-color: #9146FF;
    color: #9146FF;
}

.nav__twitch-btn.is-connected::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-green);
}

.nav__twitch-btn i.fa-twitch {
    color: #9146FF;
}

/* ============================================
   MULTI-CHANNEL INDICATOR
   ============================================ */

.twitch-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.twitch-channel-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(145, 70, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: #9146FF;
}

.twitch-channel-tag__remove {
    margin-left: 4px;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.twitch-channel-tag__remove:hover {
    opacity: 1;
}

/* ============================================
   CONNECTION STATUS BAR (optionnel)
   ============================================ */

.twitch-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.twitch-status-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.twitch-status-bar__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.twitch-status-bar__dot.is-connected {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.twitch-status-bar__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.twitch-status-bar__channel {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .twitch-modal {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .twitch-modal__header {
        flex-wrap: wrap;
    }
    
    .twitch-recent__list {
        gap: 6px;
    }
    
    .twitch-recent__item {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
