/* ============================================================
   AP Malta Training Portal — Custom styles
   Built on top of Bootstrap 5
   ============================================================ */

:root {
    --ap-navy:        #0b1f3a;
    --ap-navy-light:  #12294d;
    --ap-sky:         #2f80ed;
    --ap-sky-light:   #56ccf2;
    --ap-accent:      #f5a623;
    --ap-text:        #4a5568;
    --ap-bg:          #f7f9fc;
    --ap-radius:      14px;
    --ap-shadow:      0 10px 30px rgba(11, 31, 58, 0.12);
}

/* ---------- Base ---------- */
body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ap-text);
    background-color: #ffffff;
}

h1, h2, h3, h4, h5 {
    color: var(--ap-navy);
    font-weight: 700;
}

.section-padding {
    padding: 90px 0;
}

.section-subtitle {
    color: var(--ap-sky);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ---------- Navbar ---------- */
.navbar-ap {
    background: transparent;
    padding: 1rem 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar-ap.scrolled {
    background: rgba(11, 31, 58, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.navbar-ap .navbar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: #ffffff !important;
    letter-spacing: 0.5px;
}

.navbar-ap .navbar-brand span {
    color: var(--ap-sky-light);
}

.navbar-ap .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.2s ease;
}

.navbar-ap .nav-link:hover,
.navbar-ap .nav-link.active {
    color: var(--ap-sky-light) !important;
}

.navbar-ap .btn-login {
    background: var(--ap-accent);
    color: var(--ap-navy);
    font-weight: 700;
    border-radius: 50px;
    padding: 0.45rem 1.4rem;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.navbar-ap .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 166, 35, 0.4);
    color: var(--ap-navy);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--ap-navy) 0%, var(--ap-navy-light) 55%, #1a3a6b 100%);
    overflow: hidden;
    padding: 120px 0 80px;
}

/* decorative glowing orbs */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.hero::before {
    width: 480px;
    height: 480px;
    background: var(--ap-sky);
    top: -120px;
    right: -80px;
}

.hero::after {
    width: 380px;
    height: 380px;
    background: var(--ap-sky-light);
    bottom: -140px;
    left: -100px;
}

/* subtle flight-path grid overlay */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(86, 204, 242, 0.15);
    border: 1px solid rgba(86, 204, 242, 0.4);
    color: var(--ap-sky-light);
    padding: 0.4rem 1.1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
}

.hero h1 {
    color: #ffffff;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.15;
}

.hero h1 .highlight {
    background: linear-gradient(90deg, var(--ap-sky-light), var(--ap-sky));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.lead {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.15rem;
    max-width: 560px;
}

.hero-stats {
    margin-top: 2.5rem;
}

.hero-stats .stat-number {
    color: #ffffff;
    font-size: 1.9rem;
    font-weight: 800;
}

.hero-stats .stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* login card inside hero */
.login-card {
    background: #ffffff;
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    padding: 2.2rem;
    position: relative;
    z-index: 2;
}

.login-card h3 {
    font-size: 1.4rem;
}

.login-card .form-control {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
}

.login-card .form-control:focus {
    border-color: var(--ap-sky);
    box-shadow: 0 0 0 0.2rem rgba(47, 128, 237, 0.15);
}

.login-card .form-label {
    font-weight: 600;
    color: var(--ap-navy);
    font-size: 0.9rem;
}

.btn-login-main {
    background: linear-gradient(90deg, var(--ap-sky), var(--ap-sky-light));
    border: none;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 10px;
    width: 100%;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-login-main:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #ffffff;
}

.login-note {
    font-size: 0.8rem;
    color: #718096;
}

/* ---------- Role cards ---------- */
.roles-section {
    background: var(--ap-bg);
}

.role-card {
    background: #ffffff;
    border: none;
    border-radius: var(--ap-radius);
    box-shadow: 0 4px 16px rgba(11, 31, 58, 0.06);
    padding: 2.4rem 1.8rem;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ap-sky), var(--ap-sky-light));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.role-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ap-shadow);
}

.role-card:hover::before {
    opacity: 1;
}

.role-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: #ffffff;
    margin-bottom: 1.3rem;
}

.role-icon.trainee  { background: linear-gradient(135deg, var(--ap-sky), var(--ap-sky-light)); }
.role-icon.instructor { background: linear-gradient(135deg, #7b61ff, #b39dff); }
.role-icon.admin    { background: linear-gradient(135deg, #f5a623, #fbc02d); }

.role-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.7rem;
}

.role-card ul {
    padding-left: 1.1rem;
    margin-bottom: 0;
}

.role-card li {
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
}

/* ---------- Features section ---------- */
.feature-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.feature-item .feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(47, 128, 237, 0.1);
    color: var(--ap-sky);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.feature-item h5 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.feature-item p {
    font-size: 0.92rem;
    margin-bottom: 0;
}

/* ---------- CTA banner ---------- */
.cta-banner {
    background: linear-gradient(120deg, var(--ap-navy), var(--ap-navy-light));
    border-radius: var(--ap-radius);
    padding: 3.5rem 2.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.cta-banner h2 {
    color: #ffffff;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.75);
}

.cta-banner::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--ap-sky);
    opacity: 0.2;
    filter: blur(70px);
    top: -80px;
    right: -60px;
}

.btn-cta {
    background: var(--ap-accent);
    color: var(--ap-navy);
    font-weight: 700;
    border-radius: 50px;
    padding: 0.7rem 2rem;
    border: none;
}

.btn-cta:hover {
    background: #ffb84d;
    color: var(--ap-navy);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--ap-navy);
    color: rgba(255, 255, 255, 0.65);
    padding: 3rem 0 1.5rem;
    font-size: 0.9rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.footer a:hover {
    color: var(--ap-sky-light);
}

.footer .footer-brand {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
}

.footer .footer-brand span {
    color: var(--ap-sky-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: 0.8rem;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991px) {
    .hero {
        padding-top: 110px;
        text-align: center;
    }
    .hero p.lead {
        margin-left: auto;
        margin-right: auto;
    }
    .login-card {
        margin-top: 2.5rem;
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }
    .section-padding {
        padding: 60px 0;
    }
}


/* ============================================================
   ADMIN PANEL styles
   ============================================================ */

.admin-body {
    background: var(--ap-bg);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.admin-sidebar {
    width: 250px;
    background: var(--ap-navy);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: block;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.25rem;
    padding: 1.3rem 1.4rem;
    text-decoration: none;
}

.sidebar-brand span { color: var(--ap-sky-light); }

.sidebar-badge {
    font-size: 0.6rem;
    background: var(--ap-accent);
    color: var(--ap-navy);
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    vertical-align: middle;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a i { margin-right: 0.6rem; }

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, var(--ap-sky), var(--ap-sky-light));
    color: #ffffff;
}

.sidebar-bottom {
    padding: 1rem 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.sidebar-bottom a:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.sidebar-bottom a.text-danger:hover { background: rgba(220, 53, 69, 0.2); }

/* ---------- Main area ---------- */
.admin-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #ffffff;
    padding: 0.9rem 1.6rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(11, 31, 58, 0.06);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ap-navy);
    flex: 1;
}

.topbar-user .dropdown-toggle {
    color: var(--ap-navy);
    font-weight: 600;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ap-sky), var(--ap-sky-light));
    color: #ffffff;
    font-weight: 700;
    margin-right: 0.4rem;
}

.admin-content {
    padding: 1.8rem;
    flex: 1;
}

/* ---------- Stat cards ---------- */
.stat-card {
    background: #ffffff;
    border-radius: var(--ap-radius);
    box-shadow: 0 4px 14px rgba(11, 31, 58, 0.05);
    padding: 1.3rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ap-shadow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ap-navy);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
}

/* ---------- Panels & tables ---------- */
.panel-card {
    background: #ffffff;
    border-radius: var(--ap-radius);
    box-shadow: 0 4px 14px rgba(11, 31, 58, 0.05);
    overflow: hidden;
}

.panel-card-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #edf0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-card-header h5 { font-size: 1.05rem; }

.admin-content .table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    border-bottom: 1px solid #edf0f5;
    padding: 0.8rem 1.4rem;
}

.admin-content .table tbody td {
    padding: 0.85rem 1.4rem;
    font-size: 0.92rem;
}

.admin-content .form-control,
.admin-content .form-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
}

.admin-content .form-control:focus,
.admin-content .form-select:focus {
    border-color: var(--ap-sky);
    box-shadow: 0 0 0 0.2rem rgba(47, 128, 237, 0.15);
}

.admin-content .form-label {
    font-weight: 600;
    color: var(--ap-navy);
    font-size: 0.88rem;
}

.admin-content .btn-primary {
    background: linear-gradient(90deg, var(--ap-sky), var(--ap-sky-light));
    border: none;
    font-weight: 600;
}

.admin-content .btn-primary:hover { opacity: 0.9; }

/* ---------- Mobile sidebar ---------- */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content {
        padding: 1.2rem;
    }
}