/* CFPIC Staff Training - Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* ========================
   LOGIN SCREEN
   ======================== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 50%, #3182ce 100%);
    padding: 20px;
}

.login-container {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-logo h1 {
    font-size: 2.2rem;
    color: #1a365d;
    margin-bottom: 4px;
    letter-spacing: 2px;
    font-weight: 700;
}

.login-logo p {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-login:hover {
    background: #1a365d;
}

.btn-login:active {
    transform: scale(0.98);
}

.login-note {
    margin-top: 24px;
    font-size: 0.8rem;
    color: #a0aec0;
}

/* ========================
   HEADER
   ======================== */
.site-header {
    background: #1a365d;
    color: #fff;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-inner h1 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================
   MAIN CONTENT
   ======================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.welcome-section {
    margin-bottom: 48px;
}

.welcome-section h2 {
    font-size: 1.8rem;
    color: #1a365d;
    margin-bottom: 8px;
}

.welcome-section p {
    color: #718096;
    font-size: 1.05rem;
}

/* ========================
   TRAINING SECTIONS
   ======================== */
.training-section {
    margin-bottom: 56px;
}

.section-title {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 3px solid #3182ce;
    display: inline-block;
}

/* ========================
   VIDEO GRID
   ======================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.video-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(49, 130, 206, 0.95);
}

.video-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    overflow: hidden;
}

.video-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(49, 130, 206, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    padding-left: 4px;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.video-info {
    padding: 16px 20px;
}

.video-title {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
}

.no-videos {
    color: #a0aec0;
    font-style: italic;
    padding: 24px;
    text-align: center;
    grid-column: 1 / -1;
}

/* ========================
   LIGHTBOX
   ======================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 960px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-content video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

/* ========================
   FOOTER
   ======================== */
.site-footer {
    text-align: center;
    padding: 32px 24px;
    color: #a0aec0;
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .login-container {
        padding: 36px 28px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .header-inner h1 {
        font-size: 1.1rem;
    }

    .welcome-section h2 {
        font-size: 1.4rem;
    }

    .main-content {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 28px 20px;
    }

    .login-logo h1 {
        font-size: 1.8rem;
    }
}

/* ========================
   ADMIN PANEL STYLES
   ======================== */

/* Admin header variant */
.admin-header {
    background: #2d3748;
}

/* Header actions (logout + links) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-admin-link {
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    background: rgba(49, 130, 206, 0.3);
    border: 1px solid rgba(49, 130, 206, 0.5);
    transition: background 0.2s ease;
}

.btn-admin-link:hover {
    background: rgba(49, 130, 206, 0.5);
}

/* Admin navigation tabs */
.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.admin-nav-item {
    padding: 12px 20px;
    text-decoration: none;
    color: #718096;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.admin-nav-item:hover {
    color: #2d3748;
}

.admin-nav-item.active {
    color: #2b6cb0;
    border-bottom-color: #2b6cb0;
    font-weight: 600;
}

/* Admin content area */
.admin-content {
    max-width: 1100px;
}

/* Admin sections */
.admin-section {
    margin-bottom: 40px;
}

.admin-section h2 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Stats cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

/* Admin tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-table thead {
    background: #f7fafc;
}

.admin-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #4a5568;
    font-size: 0.9rem;
}

.admin-table tbody tr:hover {
    background: #f7fafc;
}

.admin-table .file-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #a0aec0;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-form {
    display: inline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: #c6f6d5;
    color: #22543d;
}

.badge-inactive {
    background: #fed7d7;
    color: #742a2a;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #2b6cb0;
    color: #fff;
}

.btn-primary:hover {
    background: #1a365d;
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #e53e3e;
    color: #fff;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Admin forms */
.admin-form {
    max-width: 600px;
}

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

.admin-form .form-group input[type="text"],
.admin-form .form-group input[type="password"],
.admin-form .form-group input[type="number"],
.admin-form .form-group input[type="file"],
.admin-form .form-group select,
.admin-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
    outline: none;
    font-family: inherit;
}

.admin-form .form-group input:focus,
.admin-form .form-group select:focus,
.admin-form .form-group textarea:focus {
    border-color: #3182ce;
}

.admin-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-help {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert ul {
    margin: 4px 0 0 16px;
}

/* Login admin link */
.login-admin-link {
    margin-top: 16px;
    font-size: 0.8rem;
}

.login-admin-link a {
    color: #a0aec0;
    text-decoration: none;
}

.login-admin-link a:hover {
    color: #718096;
    text-decoration: underline;
}

.login-note a {
    color: #718096;
    text-decoration: none;
}

.login-note a:hover {
    text-decoration: underline;
}

/* Section description */
.section-description {
    color: #718096;
    font-size: 0.95rem;
    margin-top: -4px;
    margin-bottom: 20px;
}

/* Video description & duration in cards */
.video-description {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 4px;
}

.video-duration {
    display: inline-block;
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 6px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #a0aec0;
    font-size: 1.1rem;
}

/* ========================
   ADMIN RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .admin-nav {
        flex-wrap: wrap;
    }

    .admin-nav-item {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }

    .header-actions {
        gap: 8px;
    }

    .btn-admin-link {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* ========================
   PROGRAMS GRID
   ======================== */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.program-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-top: 4px solid var(--program-color, #2b6cb0);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.program-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.program-icon {
    font-size: 2rem;
    line-height: 1;
}

.program-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.program-description {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.program-meta {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: #a0aec0;
    font-weight: 500;
}

/* ========================
   CATEGORIES GRID
   ======================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.category-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 24px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #3182ce;
}

.category-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.category-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

.category-card-desc {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 12px;
    line-height: 1.4;
}

.category-card-count {
    display: inline-block;
    font-size: 0.75rem;
    color: #fff;
    background: #3182ce;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* ========================
   BREADCRUMB NAVIGATION
   ======================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #cbd5e0;
    font-size: 1.1rem;
}

.breadcrumb-current {
    color: #718096;
    font-weight: 500;
}

/* ========================
   PAGE HEADER
   ======================== */
.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #1a365d;
    margin-bottom: 6px;
}

.page-header p {
    color: #718096;
    font-size: 1rem;
}

/* ========================
   ADMIN EXTRAS
   ======================== */
.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
}

.badge-program {
    display: inline-block;
    padding: 2px 8px;
    background: #edf2f7;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
}

/* Color input styling */
input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .programs-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
