/* TVET Educational Pathways System - Main CSS */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

.landing-body-bg {
    background:
        linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
        url('/docs/background.png');
    background-color: #e5e7eb;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

.landing-hero-bg {
    background: transparent;
}

.landing-glass-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.landing-glass-shell::before,
.landing-glass-shell::after {
    content: none;
}

.landing-glass-shell > .row {
    position: relative;
    z-index: 2;
}

.landing-glass-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.40) 0%, rgba(251, 253, 255, 0.40) 55%, rgba(246, 250, 255, 0.40) 100%);
    border: 1px solid rgba(173, 188, 209, 0.30);
    backdrop-filter: blur(10px) saturate(1.02);
    -webkit-backdrop-filter: blur(10px) saturate(1.02);
    box-shadow: 0 16px 34px rgba(20, 54, 106, 0.14), 0 2px 6px rgba(30, 67, 123, 0.08);
}

.landing-glass-card:hover {
    transform: none;
    box-shadow: 0 18px 38px rgba(20, 54, 106, 0.16), 0 2px 8px rgba(30, 67, 123, 0.10);
}

.landing-services-grid .service-item .bg-white {
    background-color: rgba(255, 255, 255, 0.40) !important;
    border-color: rgba(173, 188, 209, 0.30) !important;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.landing-footer-text,
.landing-footer-text a {
    color: #f8fafc !important;
    text-shadow: 0 1px 3px rgba(15, 23, 42, 0.60);
}

.landing-services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .landing-services-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }

    /* One item on final row: place it in the center column. */
    .landing-services-grid > .service-item:last-child:nth-child(3n + 1) {
        grid-column: 2;
    }

    /* Two items on final row: keep one left, move last one to the right column. */
    .landing-services-grid > .service-item:last-child:nth-child(3n + 2) {
        grid-column: 3;
    }
}

@media (max-width: 991.98px) {
    body {
        background-image: none !important;
        background: #f1f5f9 !important;
    }

    .landing-body-bg {
        background-image: none !important;
        background: #f1f5f9 !important;
    }

    .landing-glass-card {
        backdrop-filter: blur(6px) saturate(1.03);
        -webkit-backdrop-filter: blur(6px) saturate(1.03);
    }
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    background:
        var(--page-bg-gradient,
        linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
        url('/docs/background.png'));
    background-color: #e5e7eb;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.40);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: rgba(248, 250, 252, 0.50);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Tables - unified theme styling */
.table-responsive {
    border: 1px solid rgba(30, 58, 138, 0.16);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: rgba(14, 165, 233, 0.08);
    --bs-table-hover-bg: rgba(37, 99, 235, 0.14);
    --bs-table-border-color: rgba(30, 58, 138, 0.18);
}

.table > :not(caption) > * > * {
    background-color: rgba(255, 255, 255, 0.52);
    color: #0f172a;
    border-bottom-color: rgba(30, 58, 138, 0.14);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.table > thead > tr > th {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 118, 110, 0.92) 56%, rgba(14, 165, 233, 0.90) 100%);
    color: #f8fafc;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    border-bottom: 0;
}

.table > tbody > tr:hover > * {
    color: #0b1324;
}

.table.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(224, 242, 254, 0.58);
}

.table .badge {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

@media (max-width: 768px) {
    .table > :not(caption) > * > * {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        font-size: 0.86rem;
    }
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group-text {
    background-color: var(--light-color);
    border: 1px solid #d1d5db;
    border-right: none;
    color: var(--secondary-color);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

.alert-info {
    background-color: #f0f9ff;
    color: #075985;
}

.alert-warning {
    background-color: #fefce8;
    color: #a16207;
}

/* Progress Steps */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: #e5e7eb;
    z-index: 1;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.step.active .step-title,
.step.completed .step-title {
    color: var(--dark-color);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8fafc;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-registered {
    background-color: #ddd6fe;
    color: #6b21a8;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-failed {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-indicator::before {
        display: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1e293b;
        --dark-color: #f8fafc;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.border-primary { border-color: var(--primary-color) !important; }
.border-success { border-color: var(--success-color) !important; }
.border-warning { border-color: var(--warning-color) !important; }
.border-danger { border-color: var(--danger-color) !important; }
.border-info { border-color: var(--info-color) !important; }
