/* Modern Dashboard Sermon View Styles */
:root {
    --primary-color: #0099ff; /* Light blue accent */
    --primary-hover: #007acc;
    --bg-color: #f4f6f8;      /* Light dashboard background */
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e6ed;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    align-items: flex-start; /* Ensure sticky works by not stretching height */
}

/* Sidebar */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    overflow-y: auto;
    z-index: 90;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.brand-section {
    padding-bottom: 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.nav-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    font-weight: 600;
}

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

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    background-color: #e6f7ff;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Collapsed State for Desktop */
.dashboard-sidebar.collapsed {
    width: 70px;
    padding: 20px 10px;
}

.dashboard-sidebar.collapsed .brand-section h2,
.dashboard-sidebar.collapsed .nav-section h3,
.dashboard-sidebar.collapsed .nav-links a span {
    display: none;
}

.dashboard-sidebar.collapsed .brand-section h2 i {
    font-size: 1.5rem;
    margin: 0 auto;
}

.dashboard-sidebar.collapsed .nav-links a {
    justify-content: center;
    padding: 10px 5px;
}

.dashboard-sidebar.collapsed .nav-links a i {
    margin: 0;
    font-size: 1.2rem;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    /* margin-left: var(--sidebar-width); Removed for sticky/flex layout */
    padding: 30px 40px;
    min-width: 0; /* Prevent flex blowout */
}

/* Header Section */
.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.header-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Stats Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background-color: #e6f7ff; color: #0099ff; }
.stat-icon.green { background-color: #e6fffa; color: #00cc99; }
.stat-icon.purple { background-color: #f3e8ff; color: #9933ff; }

.stat-info h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-top: 5px;
}

/* Toolbar */
.library-toolbar {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

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

/* Video Grid Style */
.video-list-container {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 20px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #b3dbff;
}

.card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .card-thumb img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-card:hover .play-btn {
    transform: scale(1);
}

.card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* Fixed height for 2 lines */
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #e6fffa;
    color: #00cc99;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
    flex: 1; /* Pushes footer down */
}

.card-footer {
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.btn-watch {
    display: block;
    width: 100%;
    padding: 8px;
    text-align: center;
    background: #f0f7ff;
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-watch:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-sidebar {
        position: fixed; /* Keep fixed for mobile */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 0;
        bottom: 0;
        z-index: 1000;
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 20px;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        font-size: 1.5rem;
        color: var(--text-primary);
        cursor: pointer;
        margin-right: 15px;
    }
}

@media (min-width: 993px) {
    .mobile-menu-toggle {
        display: block; /* Make available on desktop for collapsing */
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(0,0,0,0.05);
    }
}
