/**
 * PATRIX - Navigateur Web Intégré
 * Style pour le panneau de navigation web (Audiomack, etc.)
 */

.web-browser-panel {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px; /* Contrainte PC */
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 15000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    animation: fadeIn 0.3s ease;
}

.web-browser-panel.show {
    display: flex;
}

.web-browser-panel.minimized {
    display: none;
}

.web-browser-content {
    width: 100%;
    max-width: 100%; /* Respecte le parent (600px max) */
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.web-browser-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 3px solid #5568d3;
}

.web-browser-controls {
    display: flex;
    gap: 8px;
}

.web-nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.web-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.web-nav-btn:active {
    transform: scale(0.95);
}

.web-browser-url {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.web-browser-minimize {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 152, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.web-browser-minimize:hover {
    background: rgba(255, 152, 0, 1);
    transform: scale(1.1);
}

.web-browser-minimize:active {
    transform: scale(0.95);
}

.web-browser-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 75, 75, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    order: -1;
    margin-right: 10px;
}

.web-browser-close:hover {
    background: rgba(255, 50, 50, 1);
    transform: scale(1.1);
}

.web-browser-close:active {
    transform: scale(0.95);
}

.web-browser-body {
    flex: 1;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.web-browser-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    /* GPU acceleration */
    will-change: transform;
    transform: translateZ(0);
    /* Optimiser rendu */
    contain: strict;
    content-visibility: auto;
}

/* Info confidentialité */
.web-privacy-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
}

.privacy-icon {
    font-size: 14px;
}

.privacy-text {
    line-height: 1;
}

/* Bouton musique dans le profil */
.profile-music-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-music-btn:hover {
    background: linear-gradient(135deg, #5568d3, #6a4091);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    border-color: rgba(102, 126, 234, 0.8);
}

.profile-music-btn:active {
    transform: translateY(0);
}

.profile-music-btn.music-playing {
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    animation: musicPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 12px rgba(79, 195, 247, 0.6);
}

@keyframes musicPulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(79, 195, 247, 0.6);
    }
    50% {
        box-shadow: 0 4px 20px rgba(79, 195, 247, 0.9);
    }
}

.music-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.music-text {
    font-size: 0.9em;
    line-height: 1.3;
    text-align: left;
}

/* Message de chargement */
.web-browser-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #667eea;
}

.web-browser-loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 768px) {
    .web-browser-content {
        max-width: 100%;
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        border-radius: 15px 15px 0 0;
    }

    .web-browser-header {
        padding: 12px 15px;
    }

    .web-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .web-browser-url {
        font-size: 12px;
        padding: 8px 12px;
    }

    .web-browser-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .web-privacy-info {
        font-size: 10px;
        padding: 6px 15px;
        bottom: 8px;
    }

    .privacy-icon {
        font-size: 12px;
    }

    .profile-music-btn {
        font-size: 0.9em;
    }

    .music-icon {
        font-size: 1.3em;
    }

    .music-text {
        font-size: 0.85em;
    }
}

/* ===== SÉLECTEUR DE PLAYLIST ===== */
.playlist-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 19000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.playlist-selector-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.playlist-item {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-family: 'Consolas', monospace;
}

.playlist-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
}

.playlist-item:active {
    transform: translateY(-2px);
}

.playlist-cover {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.playlist-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.playlist-close-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Consolas', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
    .playlist-selector-content {
        padding: 20px;
    }

    .playlist-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .playlist-item {
        padding: 15px;
    }

    .playlist-cover {
        font-size: 36px;
    }

    .playlist-title {
        font-size: 14px;
    }
}
