:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #f1f5f9;
    --bg-hover: #f1f5f9;
    
    /* PixelPOS Blue Tones */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;

    --font-family: 'Inter', sans-serif;
}

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

body, html {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    height: 100%;
    width: 100%;
    overflow: hidden; /* App container handles scroll */
}

/* App Layout */
.app-container {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 40;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-right: 12px;
}

.mobile-logo {
    height: 30px;
    object-fit: contain;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: 350px;
    height: 100%;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header .logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 16px;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.search-container {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
}

.search-container input {
    width: 100%;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-family);
    outline: none;
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #ffffff;
}

.video-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.video-list::-webkit-scrollbar {
    width: 6px;
}
.video-list::-webkit-scrollbar-track {
    background: transparent;
}
.video-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* Category Headers */
.category-header {
    padding: 12px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    background-color: #e2e8f0; /* More distinct background */
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* First category header doesn't need top border if it's at the very top */
.video-list .category-header:first-child {
    border-top: none;
}

/* Video Items */
.video-item {
    padding: 12px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
}

.video-item:hover {
    background-color: var(--bg-hover);
}

.video-item.active {
    background-color: var(--primary-light);
    border-left-color: var(--primary);
}

.video-item-number {
    background-color: var(--bg-main);
    color: var(--text-muted);
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.video-item.active .video-item-number {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.video-item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 32px;
}

.video-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.3;
}

.video-item.active .video-item-title {
    color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 40px;
    background-color: var(--bg-main);
    position: relative;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.main-header {
    margin-bottom: 30px;
}

.seo-badge {
    display: inline-block;
    background-color: #10b981;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.2;
}

.main-header .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Video Player Area */
.video-container {
    width: 100%;
    max-width: 1000px;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Description Area */
.description-container {
    max-width: 1000px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.description-container h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.description-container h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 24px;
    background-color: var(--primary);
    border-radius: 4px;
    margin-right: 12px;
}

.description-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Add some markdown-like styling to description content */
.description-content p {
    margin-bottom: 1em;
}
.description-content ul {
    margin-bottom: 1em;
    padding-left: 1.5em;
}
.description-content li {
    margin-bottom: 0.5em;
}
.description-content strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Welcome State */
.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
    padding: 0 20px;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-state h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.welcome-state p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
}

/* Responsive - Mobile & Tablet */
@media (max-width: 900px) {
    .app-container {
        padding-top: 60px; /* Space for mobile header */
    }
    
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        width: 320px;
        max-width: 85vw;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-header {
        display: none; /* Hide desktop header on mobile as we have the top bar */
    }
    
    .search-container {
        padding-top: 24px; /* Extra padding since header is hidden */
    }

    .main-content {
        padding: 20px 16px;
    }
    
    .main-header h1 {
        font-size: 1.5rem;
    }
    
    .description-container {
        padding: 20px;
    }
    
    .welcome-state h2 {
        font-size: 1.5rem;
    }
}
