/* =====================================================
   style.css — UKIBS Trainer Portal Main Stylesheet
   Brand Color: #F8069D (UKIBS Pink)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

:root {
    --pink:         #F8069D;
    --pink-dark:    #d40585;
    --pink-light:   #ff4db8;
    --pink-glow:    rgba(248, 6, 157, 0.15);
    --pink-glow-lg: rgba(248, 6, 157, 0.25);
    --dark:         #1a0f2e;
    --dark-2:       #2d1b4e;
    --white:        #ffffff;
    --gray-50:      #faf8fc;
    --gray-100:     #f3f0f7;
    --gray-300:     #e0e0e0;
    --gray-500:     #9e9e9e;
    --gray-700:     #555555;
    --success:      #22c55e;
    --warning:      #f59e0b;
    --shadow:       0 4px 24px rgba(248, 6, 157, 0.12);
    --shadow-lg:    0 12px 40px rgba(248, 6, 157, 0.22);
    --radius:       16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #faf0f7 0%, #fff5fa 100%);
    min-height: 100vh;
    color: var(--dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   GATE PAGE (Landing page for visitors who are not logged in)
   ===================================================== */
.gate-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--dark) 0%, #3d1273 50%, var(--pink-dark) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.gate-bg-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(248,6,157,0.25) 0%, transparent 70%);
    border-radius: 50%;
    top: -150px;
    right: -150px;
    animation: glow-pulse 5s ease-in-out infinite;
    pointer-events: none;
}

.gate-bg-glow--2 {
    bottom: -200px;
    left: -150px;
    top: auto;
    right: auto;
    animation-delay: 2.5s;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%       { transform: scale(1.15); opacity: 1; }
}

.gate-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 520px;
    width: 100%;
    color: white;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    animation: gate-appear 0.6s ease-out;
}

@keyframes gate-appear {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(248,6,157,0.6));
    animation: float 3s ease-in-out infinite;
}

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

.gate-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.gate-title span { color: var(--pink-light); }

.gate-subtitle {
    font-size: 15px;
    opacity: 0.8;
    margin-bottom: 30px;
    line-height: 1.6;
}

.gate-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.gate-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.gate-feature i {
    width: 42px;
    height: 42px;
    background: rgba(248,6,157,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--pink-light);
}

.gate-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.gate-btn {
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.gate-btn--primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(248,6,157,0.4);
}

.gate-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(248,6,157,0.5);
}

.gate-btn--secondary {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
}

.gate-btn--secondary:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.gate-admin-link {
    font-size: 13px;
    opacity: 0.6;
    margin-top: 5px;
}

.gate-admin-link a {
    color: var(--pink-light);
    text-decoration: none;
    font-weight: 500;
}

.gate-admin-link a:hover { text-decoration: underline; }

/* =====================================================
   SITE HEADER
   ===================================================== */
.main-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(248,6,157,0.08);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img { height: 42px; width: auto; }

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--pink);
    letter-spacing: -0.5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-greeting {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-2);
    background: var(--pink-glow);
    padding: 6px 14px;
    border-radius: 20px;
}

.nav-greeting i { color: var(--pink); margin-right: 4px; }

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--pink);
    background: var(--pink-glow);
}

.btn-logout {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(248,6,157,0.3);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 18px;
    color: var(--pink);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    border-color: var(--pink);
    background: var(--pink-glow);
}

/* =====================================================
   HERO SECTION (Courses page top)
   ===================================================== */
.simple-header {
    background: linear-gradient(135deg, var(--dark) 0%, #3d1273 60%, var(--pink-dark) 100%);
    padding: 45px 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.simple-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F8069D' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='15'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.simple-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.simple-header p {
    opacity: 0.85;
    font-size: 15px;
    position: relative;
}

/* =====================================================
   COURSES SECTION & GRID
   ===================================================== */
.courses-section {
    padding: 40px 0 70px;
}

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

/* =====================================================
   COURSE CARD
   ===================================================== */
.course-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: card-appear 0.5s ease-out forwards;
    border: 1px solid rgba(248,6,157,0.06);
}

@keyframes card-appear {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(248,6,157,0.15);
}

.course-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gray-100);
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.course-card:hover .course-image {
    transform: scale(1.06);
}

.course-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffe4f3 0%, #ffd0eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pink);
    font-size: 45px;
    opacity: 0.7;
}

.course-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(248,6,157,0.88), rgba(212,5,133,0.88));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.course-card:hover .course-overlay { opacity: 1; }

.overlay-content {
    text-align: center;
    color: white;
    transform: translateY(8px);
    transition: transform 0.3s ease;
}

.course-card:hover .overlay-content { transform: translateY(0); }

.overlay-content i {
    font-size: 38px;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.overlay-content span {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.course-overlay.no-pdf {
    background: linear-gradient(135deg, rgba(80,80,80,0.88), rgba(50,50,50,0.88));
}

.course-info {
    padding: 18px 20px;
}

.course-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.course-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.course-badge.available {
    background: rgba(34,197,94,0.12);
    color: #166534;
    border: 1px solid rgba(34,197,94,0.2);
}

.course-badge.pending {
    background: rgba(245,158,11,0.12);
    color: #92400e;
    border: 1px solid rgba(245,158,11,0.2);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.empty-state i {
    font-size: 60px;
    color: var(--pink);
    opacity: 0.4;
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
}

/* =====================================================
   FOOTER
   ===================================================== */
.simple-footer {
    background: var(--dark);
    color: white;
    padding: 20px 0;
    text-align: center;
}

.simple-footer p {
    opacity: 0.6;
    font-size: 13px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px 20px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.12);
        border-top: 1px solid var(--gray-300);
        gap: 8px;
        animation: menu-slide 0.25s ease-out;
    }

    @keyframes menu-slide {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .main-nav.active { display: flex; }

    .mobile-menu-btn { display: block; }

    .main-header { position: relative; }

    .nav-greeting { text-align: center; justify-content: center; }

    .nav-link { justify-content: center; padding: 10px; }

    .btn-logout { justify-content: center; padding: 12px; border-radius: 10px; }

    .simple-header h1 { font-size: 24px; }
    .simple-header p  { font-size: 13px; }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .gate-card { padding: 35px 24px; }
    .gate-title { font-size: 26px; }

    .gate-actions { gap: 10px; }
    .gate-btn { padding: 13px 24px; font-size: 15px; }
}

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

    .course-name { font-size: 13px; }
    .course-info { padding: 12px 14px; }

    .gate-features { gap: 14px; }
}

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