/* === RESET I GLOBALNE STYLE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #000; color: #b3b3b3; overflow: hidden; }
a { color: #b3b3b3; text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }
ul { list-style: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* === Style dla formularzy logowania/rejestracji === */
.form-container {
    background-color: #181818; padding: 2.5rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); width: 400px; text-align: center;
}
.form-container h2 { margin-bottom: 1.5rem; font-size: 2rem; }
.form-container input { width: 100%; padding: 0.8rem; margin-bottom: 1rem; border: none; border-radius: 4px; background-color: #282828; color: #fff; box-sizing: border-box; }
.form-container button { width: 100%; padding: 0.8rem; border: none; border-radius: 5px; background-color: #E50914; color: #fff; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background-color 0.2s; }
.form-container button:hover { background-color: #f40612; }
.form-container .message { color: #E22134; margin-bottom: 1rem; }
.form-container .message.error { color: #E22134; margin-bottom: 1rem; }
.form-container .message.success { color: #1DB954; margin-bottom: 1rem; }
.form-container .switch-link { margin-top: 1.5rem; font-size: 0.9rem; }
.form-container .switch-link a { color: #E50914; text-decoration: none; }
.form-container .back-link { margin-top: 1rem; font-size: 0.9rem; }
.form-container .back-link a { color: #b3b3b3; text-decoration: none; }
.form-container .back-link a:hover { color: #fff; }


/* === GŁÓWNA STRONA APLIKACJI (STYLE FLEX) === */
:root {
    --sidebar-width: 250px;
    --player-height: 90px;
    --dark-gray: #121212;
    --medium-gray: #181818;
    --light-gray: #b3b3b3;
}
.app-wrapper { height: 100vh; }

/* Sidebar na Desktopie */
.sidebar-desktop {
    width: var(--sidebar-width); flex-shrink: 0; background-color: #000; color: #fff; overflow-y: auto; height: 100vh;
}
.sidebar-desktop .sidebar-content { padding: 15px; }

/* Linki w sidebarze */
.sidebar-desktop a.nav-link,
.sidebar-desktop a.playlist-link,
.offcanvas-body a.nav-link,
.offcanvas-body a.playlist-link {
    color: var(--light-gray); transition: color 0.2s ease; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-desktop a.nav-link:hover,
.sidebar-desktop a.playlist-link:hover,
.sidebar-desktop a.nav-link.active,
.sidebar-desktop a.playlist-link.active,
.offcanvas-body a.nav-link:hover,
.offcanvas-body a.playlist-link:hover,
.offcanvas-body a.nav-link.active,
.offcanvas-body a.playlist-link.active {
    color: #fff;
}

/* Wrapper na treść */
.main-wrapper { flex-grow: 1; overflow: hidden; }
.main-content {
    flex-grow: 1; overflow-y: auto; background-color: var(--medium-gray); padding: 20px;
}
.content-wrapper h2 { color: #fff; font-size: 2rem; margin-bottom: 20px; }

/* Przycisk "Netflix" */
.btn-netflix { 
    background-color: #E50914; color: #fff; padding: 10px 20px; border-radius: 5px; font-weight: bold; margin-bottom: 15px; border: none;
}
.btn-netflix:hover { 
    background-color: #f40612; color: #fff;
}

/* Dostosowanie odtwarzacza na mniejszych ekranach (z index.php) */
@media (max-width: 768px) {
    .player-bar {
        padding: 0 10px;
    }
    .player-center {
        min-width: auto;
        width: 50% !important;
    }
    .player-left, .player-right {
        width: 25% !important;
    }
    .player-info {
        display: none;
    }
}
@media (min-width: 480px) and (max-width: 768px) {
     .player-info {
        display: block;
    }
}


/* === MODALE BOOTSTRAPA (Dostosowanie) === */
.modal-content.bg-dark { background-color: #282828 !important; }
.form-control.bg-secondary { background-color: #333 !important; border-color: #444 !important; }
.form-control.bg-secondary:focus { background-color: #333 !important; }
.list-group-item.bg-dark { background-color: #282828 !important; }
.modal-header.border-secondary,
.modal-footer.border-secondary,
.list-group-item.border-secondary {
    border-color: #333 !important; 
}
.add-song-to-playlist-action.btn-link { 
    width: 100%; text-align: left; color: #fff !important; text-decoration: none; padding: 10px 5px; border-radius: 4px;
}
.add-song-to-playlist-action.btn-link:hover { background-color: #333; text-decoration: none; }


/* === MODAL ODTWARZACZA WIDEO === */
#videoPlayerModal .modal-content {
    background-color: #000; border: none;
}
.video-player-container {
    position: relative; width: 100%; height: 100%; overflow: hidden;
}
#video-player { width: 100%; height: 100%; }
.video-controls {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 15px; background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0)); opacity: 0; transition: opacity 0.3s ease;
}
.video-player-container:hover .video-controls { opacity: 1; }
.video-controls-row {
    display: flex; justify-content: space-between; align-items: center; gap: 15px;
}
#video-progress-bar { flex-grow: 1; height: 5px; }
.video-controls-row span { font-size: 0.9rem; color: #fff; min-width: 40px; text-align: center; }
.video-controls-row button { font-size: 1.5rem; color: #fff; }
#video-volume-slider { width: 100px; height: 5px; }
#videoPlayerModal .btn-close-video {
    position: absolute; top: 20px; right: 20px; z-index: 10; font-size: 2rem; color: #fff; opacity: 0.7;
}
#videoPlayerModal .btn-close-video:hover { opacity: 1; }
input[type="range"] {
    -webkit-appearance: none; appearance: none; height: 4px; background: #404040; border-radius: 5px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 12px; height: 12px; background: #E50914; border-radius: 50%;
}
input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px; background: #E50914; border-radius: 50%;
}


/* === SIATKA FILMÓW (OKIENKA) === */
.films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.film-card {
    background-color: #282828;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.film-card:hover {
    transform: scale(1.05);
    background-color: #333;
    z-index: 5;
}
.film-card-thumbnail {
    width: 100%;
    padding-top: 56.25%; /* Proporcje 16:9 */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #181818;
}
.film-card-thumbnail::after {
    content: '\F4F4'; /* Ikona Bootstrap 'play-fill' (sam trójkąt) */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}
.film-card:hover .film-card-thumbnail::after {
    opacity: 1;
}
.play-btn-film-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2; 
    background: none;
    border: none;
}
.film-card-info { padding: 15px; }
.film-card-title {
    font-size: 1.1rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px;
}
.film-card-director {
    font-size: 0.9rem; color: var(--light-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.film-card-actions {
    display: flex; justify-content: flex-end; padding: 0 10px 10px 10px; gap: 5px;
}
.film-card-actions button {
    font-size: 1.1rem; color: var(--light-gray); background-color: rgba(255, 255, 255, 0.1); border-radius: 50%; width: 32px; height: 32px; display: flex; justify-content: center; align-items: center; transition: all 0.2s ease;
}
.film-card-actions button:hover {
    color: #fff; background-color: rgba(255, 255, 255, 0.2);
}
.film-card-actions .delete-film-btn:hover {
    color: #E50914; 
}

/* === NOWE STYLE: Przycisk Napisów (CC) === */
#video-cc-btn {
    display: none; /* Domyślnie ukryty. JS go pokaże, jeśli są napisy. */
}
#video-cc-btn.active {
    color: #E50914; /* Kolor Netflix Red, gdy napisy są włączone */
}