/* Kidus Petros EMR Training Portal - Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;600;700;900&display=swap');

:root {
    /* Color Palette */
    --primary-color: #00a99e;       /* Neon Teal */
    --primary-glow: rgba(0, 169, 158, 0.4);
    --primary-glow-strong: rgba(0, 169, 158, 0.7);
    --accent-color: #f26525;        /* Neon Orange */
    --accent-glow: rgba(242, 101, 37, 0.4);
    
    --bg-dark: #0b1120;             /* Deep Blue-Black */
    --bg-card: rgba(15, 23, 42, 0.55);
    --bg-card-hover: rgba(30, 41, 59, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-glow: rgba(248, 250, 252, 0.8);
    
    --success-color: #10b981;
    --error-color: #ef4444;
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 169, 158, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(242, 101, 37, 0.08) 0%, transparent 40%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Grid Overlay */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 45px 45px;
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
    perspective: 1000px;
}

/* Elegant Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 6px;
    border: 2px solid transparent;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Navigation Bar */
.navbar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.nav-brand img {
    height: 48px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
    transition: transform 0.3s ease;
}

.nav-brand:hover img {
    transform: scale(1.05);
}

.brand-details h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    text-transform: uppercase;
}

.brand-details span {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Premium Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #007c74);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--primary-glow-strong);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), #b43d0b);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(242, 101, 37, 0.7);
}

/* Page Layout Grid */
.container {
    max-width: 1500px;
    width: 95%;
    margin: 30px auto;
    flex: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
}

/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
}

/* Left Sidebar - Video List & Filters */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 130px);
    position: sticky;
    top: 100px;
}

.search-box {
    position: relative;
    margin-bottom: 5px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 169, 158, 0.25);
    background: rgba(15, 23, 42, 0.8);
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-box input:focus + svg {
    color: var(--primary-color);
}

/* Categories Filter Tags */
.category-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-filter-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tag.active {
    background: rgba(0, 169, 158, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 169, 158, 0.2);
}

/* Playlist / Video Cards Container */
.video-playlist-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.video-item {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.video-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.video-item.active {
    background: rgba(0, 169, 158, 0.08);
    border-color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    box-shadow: inset 0 0 10px rgba(0, 169, 158, 0.05);
}

.video-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.video-item.active .video-item-title,
.video-item:hover .video-item-title {
    color: var(--primary-color);
}

.video-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.badge-primary {
    background: rgba(0, 169, 158, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.video-item-date {
    color: var(--text-muted);
}

/* Center Content - Video Viewer */
.viewer-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 500px;
}

/* Interactive Video Box */
.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.video-player-container.active-playing {
    border-color: var(--primary-color);
    box-shadow: 0 0 25px var(--primary-glow);
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-details-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.video-details-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.video-details-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    background: rgba(15, 23, 42, 0.25);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

/* Empty State / Welcome Screen */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.2);
    min-height: 480px;
    flex: 1;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 24px;
    animation: iconFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 500px;
    font-size: 1rem;
    margin-bottom: 30px;
}

/* Stats Display in Welcome */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 550px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(242, 101, 37, 0.2);
}

.stat-item-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* --- Admin Portal Styles --- */
.admin-login-wrapper {
    max-width: 450px;
    width: 90%;
    margin: 80px auto;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-header h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-color);
    font-size: 1.8rem;
    text-shadow: 0 0 10px var(--accent-glow);
    text-transform: uppercase;
}

.admin-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 169, 158, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.embed-preview {
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 10px;
}

/* Admin Dashboard layout */
.admin-container {
    max-width: 1500px;
    width: 95%;
    margin: 30px auto;
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    align-items: start;
}

/* List of videos in admin panel */
.admin-table-card {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.admin-video-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.admin-video-item:hover {
    border-color: rgba(242, 101, 37, 0.4);
    background: rgba(15, 23, 42, 0.6);
}

.admin-video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-video-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Alert/Notifications */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Media Controls Bar */
.custom-controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    margin-top: -10px; /* pull closer to player container */
    animation: fadeIn 0.3s ease;
    z-index: 20;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 4px;
}

.control-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

.control-time {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 90px;
    text-align: center;
}

/* Custom Interactive Progress Bar Seeker */
.progress-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-bar-filled {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #00c4b8);
    border-radius: 4px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--primary-glow);
}

.progress-container:hover .progress-bar-filled {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Volume Slider styling */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px var(--primary-glow);
    transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-color);
}

/* Playback Speed dropdown */
.speed-container {
    display: flex;
    align-items: center;
}

.speed-selector {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.speed-selector:focus, .speed-selector:hover {
    border-color: var(--primary-color);
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
    .container, .admin-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        max-height: none;
        position: static;
    }
    
    .video-playlist-container {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .brand-details {
        text-align: left;
    }
    
    .video-details-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .admin-video-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-actions {
        justify-content: flex-end;
    }
    
    .custom-controls-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .progress-container {
        order: -1;
        width: 100%;
        flex: none;
    }
}
