@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --font-family: 'Outfit', 'Inter', sans-serif;
    --bg-main: #131110;
    --bg-sidebar: #221B19;
    --bg-card: #2D2422;
    --bg-card-hover: #3D312E;
    --bg-input: #322825;
    
    --accent-color: #FE4C24;
    --accent-color-rgb: 254, 76, 36;
    --accent-gradient: linear-gradient(135deg, #FE4C24 0%, #FF7849 100%);
    --border-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #FFFFFF;
    --text-secondary: #A39692;
    --text-muted: #6C605D;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glow-color: rgba(254, 76, 36, 0.25);
    --sidebar-width: 96px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
    padding: 24px;
    gap: 24px;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    position: fixed;
    top: 24px;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    border: 1px solid var(--border-glass);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.sidebar-logo {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo i {
    font-size: 28px;
    color: var(--accent-color);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    width: 100%;
    align-items: center;
}

.sidebar-item {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
}

.sidebar-item i {
    font-size: 22px;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.sidebar-item.active {
    background-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(254, 76, 36, 0.4);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: center;
}

/* Main Content Area */
.app-content {
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 12px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: calc(100% - var(--sidebar-width) - 12px);
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    height: 60px;
}

.user-greeting h4 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    text-transform: capitalize;
}

.user-greeting h1 {
    font-size: 28px;
    font-weight: 700;
}

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

.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    width: 100%;
    height: 48px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 0 20px 0 48px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 15px;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(254, 76, 36, 0.15);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-glass);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.user-avatar:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Media Dashboard Structure */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
}

/* Hero Player Panel */
.hero-player-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    background-color: #000;
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    z-index: 5;
}

.video-overlay * {
    pointer-events: auto;
}

.video-tag {
    background-color: rgba(254, 76, 36, 0.2);
    color: var(--accent-color);
    border: 1px solid rgba(254, 76, 36, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    align-self: flex-start;
}

.video-title {
    font-size: 32px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.video-controls {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(254, 76, 36, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Recommended Sidebar List */
.recommended-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title span.badge {
    background-color: var(--bg-card);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.media-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
}

.media-item-row {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.media-item-row:hover, .media-item-row.active {
    background-color: var(--bg-card-hover);
    border-color: rgba(254, 76, 36, 0.3);
    transform: translateX(4px);
}

.media-item-row.active {
    background-color: rgba(254, 76, 36, 0.08);
}

.media-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.media-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.media-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    overflow: hidden;
}

.media-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.media-group {
    font-size: 13px;
    color: var(--text-secondary);
}

.favorite-btn {
    align-self: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-smooth);
}

.favorite-btn:hover {
    color: #FF4B4B;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #FF4B4B;
}

/* Category Grid / Selector (Mockup Bottom Bar) */
.categories-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.category-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    height: 52px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 14px;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-glass);
    text-decoration: none;
    color: var(--text-primary);
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.category-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    margin: 0;
}

.category-card:hover {
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: rgba(254, 76, 36, 0.2);
}

.category-card.active {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 6px 15px rgba(254, 76, 36, 0.25);
}

.category-card.active .category-icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-card.active h3 {
    color: white;
    font-weight: 600;
}

/* Video Quality Selector Styles */
.video-quality-selector {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.quality-btn {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.quality-btn:hover {
    background: rgba(254, 76, 36, 0.9);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(254, 76, 36, 0.35);
}

.quality-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(34, 27, 25, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.quality-dropdown.show {
    display: flex;
}

.quality-option {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.quality-option.active {
    background: rgba(254, 76, 36, 0.15);
    color: var(--accent-color);
    font-weight: 600;
}

/* Movies View Grid */
.movies-explorer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.genre-chips {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.genre-chip {
    padding: 8px 20px;
    background-color: var(--bg-card);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.genre-chip:hover, .genre-chip.active {
    background-color: var(--accent-color);
    color: white;
    border-color: transparent;
}

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

.movie-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-sidebar);
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(254, 76, 36, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #FFC107;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.movie-details-brief {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.movie-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Movie Details Layout */
.detail-container {
    display: grid;
    grid-template-columns: 1.40fr 1fr;
    gap: 32px;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.movie-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.movie-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-main) 10%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.1) 100%);
}

.detail-info-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-title {
    font-size: 38px;
    font-weight: 800;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-rating {
    color: #FFC107;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-overview {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Profile / Settings UI */
.profile-card {
    background-color: var(--bg-card);
    border-radius: 24px;
    padding: 32px;
    border: 1px solid var(--border-glass);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    height: 48px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 15px;
    transition: var(--transition-smooth);
}

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

.avatar-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.avatar-option {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-option.selected {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Skeleton Loading Shimmer */
.shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, #3d312e 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.shimmer-card {
    height: 240px;
    border-radius: 16px;
}

.shimmer-row {
    height: 100px;
    border-radius: 16px;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Playback Indicators */
.playing-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .dashboard-grid, .detail-container {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 12px;
    }
    .app-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 12px;
        top: 0;
        bottom: 0;
        left: 0;
    }
    .sidebar-menu {
        flex-direction: row;
        justify-content: space-around;
        gap: 8px;
    }
    .sidebar-logo, .sidebar-footer {
        display: none;
    }
    .app-content {
        margin-left: 0;
        max-width: 100%;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Responsive Header & Search Bar */
    .app-header {
        flex-direction: row;
        height: auto;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .user-greeting {
        flex-shrink: 0;
    }

    .user-greeting h4 {
        font-size: 11px;
        line-height: 1.2;
    }

    .user-greeting h1 {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 110px;
        line-height: 1.2;
    }

    .header-right {
        flex: 1;
        gap: 10px;
        justify-content: flex-end;
        width: auto;
    }

    .search-box {
        flex: 1;
        width: auto;
        min-width: 100px;
        max-width: 100%;
    }

    .search-box input {
        height: 40px;
        padding: 0 14px 0 36px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .search-box i {
        left: 12px;
        font-size: 14px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
}
