/* GoStream Styles */
:root {
    --primary-color: #e50914;
    --primary-hover: #f40612;
    --background: #141414;
    --background-light: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #333333;
    --success-color: #46d369;
    --error-color: #e87c03;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Authentication Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, .9) 100%),
        url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxwYXR0ZXJuIGlkPSJhIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiPjxwYXRoIGQ9Ik0wIDQwTDQwIDBIMCA2IiBzdHJva2U9IiMzMzMiIGZpbGw9Im5vbmUiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjYSkiLz48L3N2Zz4=');
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-box {
    background: var(--background-light);
    border-radius: 4px;
    padding: 60px 68px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}

.logo h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.logo .tagline {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.auth-form h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 16px;
    background: #333;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.4;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    padding: 8px;
}

.btn-link:hover {
    color: var(--text-primary);
}

.form-footer {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.form-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.error-message,
.success-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.error-message {
    background: rgba(232, 124, 3, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.success-message {
    background: rgba(70, 211, 105, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Profiles Page */
.profiles-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.profiles-container {
    text-align: center;
    max-width: 800px;
    padding: 20px;
}

.profiles-header h1 {
    font-size: 3.5vw;
    margin-bottom: 40px;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.profile-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.profile-card:hover {
    transform: scale(1.1);
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 4px;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin-bottom: 10px;
    border: 3px solid transparent;
}

.profile-card:hover .profile-avatar {
    border-color: var(--text-primary);
}

.profile-name {
    color: var(--text-secondary);
    font-size: 16px;
}

.profile-card:hover .profile-name {
    color: var(--text-primary);
}

.profiles-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--background-light);
    padding: 40px;
    border-radius: 4px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    color: var(--text-secondary);
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.avatar-selection {
    margin: 20px 0;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.avatar-option {
    width: 60px;
    height: 60px;
    background: var(--background);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    border: 2px solid transparent;
}

.avatar-option:hover,
.avatar-option.selected {
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Dashboard */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(20, 20, 20, .9) 10%, rgba(20, 20, 20, 0));
    padding: 20px 4%;
    z-index: 100;
    transition: background 0.3s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.navbar.scrolled {
    background: rgba(20, 20, 20, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.brand {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--background-light);
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: var(--background-light);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: var(--background);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 20px 0;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-list a {
    display: block;
    padding: 16px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-nav-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-list a:hover,
.mobile-nav-list a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-list a.active::before {
    transform: scaleY(1);
}

/* Search Toggle */
.search-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s;
}

.search-toggle:hover {
    opacity: 0.8;
}

.search-box {
    position: relative;
}

.dashboard-main {
    padding-top: 80px;
    padding: 100px 4% 50px;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.media-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.media-card {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.media-card:hover {
    transform: scale(1.05);
}

.media-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 4px;
}

.media-title {
    margin-top: 8px;
    font-size: 14px;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-box {
        padding: 40px 30px;
    }

    .profiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-left {
        gap: 15px;
    }

    .nav-menu {
        display: none;
    }

    .media-row {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Settings Page Styles */
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.settings-container>h1 {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.settings-section {
    background: var(--surface);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

/* Storage List */
.storage-list {
    margin-bottom: 30px;
}

.storage-card {
    background: var(--background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.storage-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.storage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.storage-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.storage-card-body {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.storage-path,
.storage-detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.storage-path {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
}

.badge-local {
    background: #2196F3;
    color: white;
}

.badge-smb {
    background: #FF9800;
    color: white;
}

.badge-nfs {
    background: #9C27B0;
    color: white;
}

.badge-success {
    background: #4CAF50;
    color: white;
}

.badge-error {
    background: #f44336;
    color: white;
}

.badge-movies {
    background: #E50914;
    color: white;
}

.badge-series {
    background: #0891B2;
    color: white;
}

.badge-mixed {
    background: #8B5CF6;
    color: white;
}

/* Add Mount Section */
.add-mount-section {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
}

.add-mount-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.mount-form {
    max-width: 800px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--background);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Buttons */
.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.error-state {
    text-align: center;
    color: #f44336;
    padding: 40px;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.empty-state p {
    margin-bottom: 10px;
}

/* Responsive Settings */
@media (max-width: 768px) {
    .settings-container {
        padding: 20px 15px;
    }

    .settings-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .storage-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .storage-actions {
        margin-top: 15px;
    }
}

/* Video Player Modal - Netflix Style */
.player-modal {
    z-index: 9999 !important;
    background-color: rgba(0, 0, 0, 0.98);
}

.player-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    padding: 0;
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

#video-player {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    outline: none;
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    padding: 40px 60px 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

#video-player-container:hover .player-controls {
    opacity: 1;
}

.player-modal .close {
    position: fixed;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.player-modal .close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#player-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

#player-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Continue Watching Progress Bar */
.media-card {
    position: relative;
}

.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.continue-watching-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* Continue Watching Progress Overlay */
.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.progress-overlay .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #e50914);
    transition: width 0.3s ease;
}

.continue-watching-card {
    position: relative;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Fullscreen styles */
.player-modal:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.player-modal:-moz-full-screen {
    width: 100%;
    height: 100%;
}

.player-modal:fullscreen {
    width: 100%;
    height: 100%;
}

#video-player:fullscreen {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}

/* Hide native controls when using custom controls */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Keep native controls visible for now */
#video-player {
    width: 100%;
}

/* User Management Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.users-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.users-table th {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    color: var(--text-secondary);
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-approved {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.badge-admin {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.section-description {
    color: var(--text-secondary);
    margin: 10px 0 20px 0;
}

/* Button variants */
.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.text-muted {
    color: var(--text-secondary);
}

/* Mobile Responsive Design */
@media only screen and (max-width: 768px) {

    /* General mobile adjustments */
    body {
        font-size: 14px;
    }

    /* Navbar adjustments */
    .navbar {
        padding: 10px 15px;
        background: rgba(20, 20, 20, 1) !important;
    }

    .navbar-content {
        gap: 10px;
    }

    .navbar-left {
        gap: 15px;
    }

    /* Show hamburger menu */
    .hamburger-menu {
        display: flex;
    }

    /* Hide desktop nav menu */
    .nav-menu {
        display: none;
    }

    /* Show mobile menu */
    .mobile-menu {
        display: block;
    }

    .brand {
        font-size: 20px;
    }

    /* Navbar right adjustments */
    .navbar-right {
        gap: 10px;
    }

    /* Show search toggle button, hide search input by default */
    .search-toggle {
        display: block;
    }

    .search-box input {
        display: none;
        position: fixed;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 120px);
        max-width: 400px;
        z-index: 102;
        background: rgba(0, 0, 0, 0.95);
        border: 1px solid var(--border-color);
        padding: 10px 15px;
    }

    .search-box input.active {
        display: block;
    }

    /* User menu adjustments */
    .user-menu {
        gap: 5px;
    }

    .profile-avatar {
        width: 28px;
        height: 28px;
    }

    .dropdown span {
        display: none;
    }

    .dropdown-content {
        right: 0;
        top: 40px;
    }

    /* Dashboard layout */
    .dashboard-main {
        padding: 80px 10px 10px;
    }

    .content-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    /* Media cards */
    .media-row {
        gap: 8px;
        padding: 0;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .media-card {
        min-width: 110px;
    }

    .media-title {
        font-size: 11px;
        margin-top: 4px;
    }

    /* Genre filter mobile */
    .genre-filter {
        width: 100%;
        margin-top: 10px;
    }

    .genre-filter select {
        width: 100%;
        max-width: 200px;
        font-size: 14px !important;
    }

    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    /* Video Player Modal - Mobile Optimized */
    .player-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        /* Use env() for iOS safe areas */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        overflow: hidden;
    }

    .player-content {
        width: 100%;
        height: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    #video-player-container {
        width: 100%;
        height: 100%;
        position: relative;
    }

    #video-player {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain;
    }

    /* Close button for mobile */
    .player-modal .close {
        position: fixed;
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        font-size: 32px;
        width: 40px;
        height: 40px;
        line-height: 40px;
        z-index: 10001;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 50%;
        cursor: pointer;
    }

    /* Details modal mobile */
    .details-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .details-header img {
        height: 200px;
    }

    /* Settings page mobile */
    .settings-container {
        padding: 15px;
    }

    .settings-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    /* User management table mobile */
    .users-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .users-table thead {
        display: none;
        /* Hide headers on mobile */
    }

    .users-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 10px;
    }

    .users-table td {
        display: block;
        text-align: left;
        padding: 5px 0;
        border: none;
    }

    .users-table td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
    }

    /* Buttons mobile */
    .btn-sm {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Tablet Responsive Design (768px - 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        padding: 15px 3%;
    }

    .navbar-left {
        gap: 20px;
    }

    .nav-menu {
        gap: 15px;
    }

    .nav-menu a {
        font-size: 13px;
    }

    .dashboard-main {
        padding: 90px 3% 40px;
    }

    .media-row {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .content-section h2 {
        font-size: 20px;
    }
}

/* Mobile landscape orientation */
@media only screen and (max-width: 896px) and (orientation: landscape) {
    .player-modal {
        position: fixed;
        width: 100vw;
        height: 100vh;
    }

    #video-player {
        width: 100vw;
        height: 100vh;
        object-fit: contain;
    }

    .player-modal .close {
        top: max(5px, env(safe-area-inset-top));
        right: 5px;
        font-size: 28px;
        width: 36px;
        height: 36px;
        line-height: 36px;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {

    /* iOS Safari specific */
    .player-modal {
        /* Fix for iOS viewport units */
        height: -webkit-fill-available;
    }

    #video-player {
        /* Enable inline playback on iOS */
        -webkit-playsinline: true;
    }
}



/* Details Modal Styles */
.details-content {
    background-color: #181818;
    width: 100%;
    max-width: 850px;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin: auto;
}

.details-header {
    position: relative;
    width: 100%;
    height: 480px;
}

#detail-backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
}

.details-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(to top, #181818 0%, transparent 100%);
}

#detail-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.details-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
}

#detail-rating {
    color: #46d369;
}

.details-actions {
    display: flex;
    gap: 15px;
}

.details-body {
    padding: 0 40px 40px;
}

#detail-overview {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #d2d2d2;
}

.details-info {
    font-size: 14px;
    color: #777;
}

.details-info span {
    color: #fff;
}

/* Mobile Adjustments for Details Modal */
@media (max-width: 768px) {
    .details-content {
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .details-header {
        height: 40vh;
        flex-shrink: 0;
    }

    .details-body {
        padding: 20px;
        flex-grow: 1;
        overflow-y: auto;
    }

    #detail-title {
        font-size: 32px;
    }

    .details-overlay {
        padding: 20px;
    }
}
/* Series Modal */
.series-content {
    background-color: #181818;
    width: 100%;
    max-width: 1200px;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.series-header {
    position: relative;
    width: 100%;
    height: 400px;
    flex-shrink: 0;
}

#series-backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
}

.series-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(to top, #181818 0%, transparent 100%);
}

#series-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.series-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.series-overview-text {
    font-size: 16px;
    line-height: 1.6;
    color: #d2d2d2;
    max-width: 80%;
}

.series-body {
    padding: 30px 40px 40px;
    overflow-y: auto;
    flex-grow: 1;
}

.series-body h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.seasons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Season Card */
.season-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.season-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.season-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.season-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.expand-icon {
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.episodes-list {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Episode Card */
.episode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.episode-card:hover .episode-play-icon {
    opacity: 1;
}

.episode-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-overview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.episode-meta {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.episode-play-icon {
    font-size: 20px;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    min-width: 30px;
    text-align: center;
}

/* Mobile Adjustments for Series Modal */
@media (max-width: 768px) {
    .series-content {
        height: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .series-header {
        height: 30vh;
    }

    .series-overlay {
        padding: 20px;
    }

    #series-title {
        font-size: 28px;
    }

    .series-overview-text {
        font-size: 14px;
        max-width: 100%;
    }

    .series-body {
        padding: 20px;
    }

    .series-body h2 {
        font-size: 20px;
    }

    .season-header {
        padding: 16px;
    }

    .season-header h3 {
        font-size: 18px;
    }

    .episodes-list {
        padding: 0 16px 16px;
    }

    .episode-card {
        padding: 12px;
        gap: 12px;
    }

    .episode-number {
        font-size: 16px;
        min-width: 35px;
    }

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

    .episode-overview {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }

    .episode-play-icon {
        opacity: 1;
        font-size: 18px;
    }
}

/* Audio Track Selector */
.audio-track-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.audio-track-selector label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
}

.audio-track-selector select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-track-selector select:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

.audio-track-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

@media (max-width: 768px) {
    .audio-track-selector {
        margin: 10px 0;
        padding: 10px 12px;
    }

    .audio-track-selector label {
        font-size: 13px;
        min-width: 45px;
    }

    .audio-track-selector select {
        font-size: 13px;
        padding: 6px 10px;
    }
}
