/* ============================================================
   AWP-CMS — Main Stylesheet
   Color palette:
     #009639 (primary green)
     #ffd700 (gold / accent)
     #1e6031 (dark green — header / footer)
     #e0a70d (dark gold)
   Font: Libre Franklin
   ============================================================ */

/* ── Font-Face (Libre Franklin) ──────────────────────────── */
@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/LibreFranklin-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/LibreFranklin-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #009639;
    text-decoration: none;
    transition: color .2s ease;
}
a:hover {
    color: #00c94a;
}
a:focus-visible {
    outline: 2px solid #009639;
    outline-offset: 2px;
}

/* ── Navbar (dark green) ─────────────────────────────────── */
.awp-navbar {
    background-color: #1e6031;
    min-height: 64px;
}
.awp-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.awp-navbar .navbar-brand img {
    filter: brightness(0) invert(1);
}
.awp-navbar .nav-link {
    color: rgba(255,255,255,.85);
    font-weight: 500;
    padding: .5rem 1rem;
    border-radius: .375rem;
    transition: background-color .2s, color .2s;
}
.awp-navbar .nav-link:hover,
.awp-navbar .nav-link:focus {
    color: #fff;
    background-color: rgba(255,255,255,.12);
}
.awp-navbar .dropdown-menu {
    border: none;
    border-radius: .5rem;
    padding: .5rem 0;
}
.awp-navbar .dropdown-item {
    padding: .5rem 1.25rem;
    font-weight: 500;
}
.awp-navbar .dropdown-item:hover {
    background-color: #e8f5e9;
    color: #009639;
}

/* Avatar circle */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffd700;
    color: #1e6031;
    font-weight: 700;
    font-size: .875rem;
}

/* Avatar circle (profile page) */
.avatar-circle-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #009639 0%, #1e6031 100%);
    color: #ffd700;
    font-weight: 700;
    font-size: 2rem;
    border: 4px solid #ffd700;
}

/* ── Auth Pages (login, register, forgot) ────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.10), 0 4px 20px rgba(0,0,0,.06);
    overflow: hidden;
}
.auth-card.auth-card-lg {
    max-width: 520px;
}

.auth-card .auth-header {
    background-color: #1e6031;
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.auth-card .auth-header img {
    height: 56px;
    margin-bottom: .75rem;
    filter: brightness(0) invert(1);
}

.auth-card .auth-header h4 {
    color: #fff;
    font-weight: 700;
    margin: 0;
    letter-spacing: .5px;
}

.auth-card .auth-body {
    padding: 2rem 2rem 2.5rem;
}

.auth-card .auth-body .form-label {
    font-weight: 600;
    font-size: .875rem;
    color: #555;
    margin-bottom: .25rem;
}

.auth-card .auth-body .form-control,
.auth-card .auth-body .form-select {
    border-radius: .5rem;
    border: 1.5px solid #dee2e6;
    padding: .6rem 1rem;
    font-size: .9375rem;
    transition: border-color .2s, box-shadow .2s;
}
.auth-card .auth-body .form-control:focus,
.auth-card .auth-body .form-select:focus {
    border-color: #009639;
    box-shadow: 0 0 0 3px rgba(0,150,57,.15);
}

/* ── Extra small button ──────────────────────────────────── */
.btn-xs {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.35rem;
    line-height: 1.4;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-awp-primary {
    background-color: #009639;
    border-color: #009639;
    color: #fff;
    font-weight: 600;
    padding: .6rem 1.5rem;
    border-radius: .5rem;
    transition: background-color .2s, transform .1s;
}
.btn-awp-primary:hover {
    background-color: #007a2e;
    border-color: #007a2e;
    color: #fff;
    transform: translateY(-1px);
}
.btn-awp-primary:active {
    transform: translateY(0);
}

.btn-awp-gold {
    background-color: #ffd700;
    border-color: #ffd700;
    color: #1e6031;
    font-weight: 600;
    padding: .6rem 1.5rem;
    border-radius: .5rem;
    transition: background-color .2s, transform .1s;
}
.btn-awp-gold:hover {
    background-color: #e0a70d;
    border-color: #e0a70d;
    color: #1e6031;
    transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────────────── */
.awp-footer {
    background-color: #1e6031;
    color: rgba(255,255,255,.85);
    padding: 1.25rem 0;
    margin-top: auto;
    font-size: .875rem;
}
.awp-footer a {
    color: #ffd700;
}
.awp-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Dashboard Cards ─────────────────────────────────────── */
.dashboard-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .2s;
}
.dashboard-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.dashboard-card .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-awp {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.table-awp thead th {
    background-color: #1e6031;
    color: #fff;
    font-weight: 600;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .75rem 1rem;
    border: none;
}
.table-awp tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}
.table-awp tbody tr:hover {
    background-color: #f0fdf4;
}

/* ── OTP Timer ───────────────────────────────────────────── */
.otp-timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #009639;
    font-variant-numeric: tabular-nums;
}
.otp-timer.warning {
    color: #dc3545;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 576px) {
    .auth-card .auth-header,
    .auth-card .auth-body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* ── DataTables overrides ────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
    border-radius: .5rem;
    border: 1.5px solid #dee2e6;
    padding: .35rem .75rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #009639 !important;
    border-color: #009639 !important;
    color: #fff !important;
    border-radius: .375rem;
}

/* ── Dashboard stat card icon colours ──────────────────── */
.bg-stat-activated   { background-color: #28a745; }
.bg-stat-pending     { background-color: #ffc107; }
.bg-stat-deactivated { background-color: #dc3545; }

/* ── Profile avatar gold border ────────────────────────── */
.profile-border {
    border: 4px solid #ffd700;
}

/* ── Landing Page ──────────────────────────────────────────── */
.landing-page,
.landing-page body,
html.landing-page {
    height: 100vh;
    overflow-y: auto;
}
.landing-page .hero-section {
    padding: 0.75rem 0;
}
.landing-page .hero-title {
    font-size: 2rem;
}
.landing-page .hero-section .mb-3 {
    margin-bottom: 0.5rem !important;
}
.landing-page .hero-section img {
    width: 64px !important;
    height: 64px !important;
}
.landing-page .cards-section {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0 1.5rem;
}
.landing-page .cards-section::-webkit-scrollbar {
    width: 6px;
}
.landing-page .cards-section::-webkit-scrollbar-thumb {
    background: rgba(0,150,57,.3);
    border-radius: 3px;
}
.landing-page .survey-group {
    margin-bottom: 2rem;
}
.landing-page .survey-group:last-child {
    margin-bottom: 0;
}
.landing-page .survey-type-badge {
    background: none;
    color: #000;
    font-size: 1rem;
    padding: 0;
    box-shadow: none;
    text-transform: uppercase;
}
.landing-page .survey-type-badge sup {
    text-transform: none;
}
.landing-page .program-card .card-body {
    padding: 1.25rem;
    text-align: center;
}
.landing-page .program-card .card-title {
    font-size: 1.3rem;
    line-height: 1.5;
    color: #1e6031;
    margin-bottom: 0.5rem;
}
.landing-page .program-card .title-line2 {
    display: block;
    white-space: nowrap;
}
.landing-page .program-card .badge {
    font-size: 0.9rem;
    align-self: center !important;
    margin-bottom: 0.75rem !important;
}
.landing-page .program-card .btn-xs {
    font-size: 0.8rem;
    padding: 0.3rem 0.85rem;
}

/* ── Misc ────────────────────────────────────────────────── */
.text-awp-primary { color: #009639; }
.bg-awp-primary   { background-color: #009639; }
.bg-awp-dark      { background-color: #1e6031; }
.border-awp       { border-color: #009639; }

/* ── Font weight utility ────────────────────────────────── */
.fw600 { font-weight: 600; }

/* ── Program Cards (front page) ─────────────────────────── */
.program-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    transition: box-shadow .3s, transform .3s;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.program-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #009639, #ffd700, #009639);
    opacity: 0;
    transition: opacity .3s;
}
.program-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.10);
    transform: translateY(-4px);
}
.program-card:hover::before {
    opacity: 1;
}
.program-card .btn-access {
    pointer-events: none;
}
.program-card:hover .btn-access {
    pointer-events: auto;
}
.program-card .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    flex-shrink: 0;
}

/* ── Folder Cards ──────────────────────────────────────────── */
.folder-card {
    transition: box-shadow .2s, transform .2s, border-color .2s;
    border-color: #e9ecef !important;
}
.folder-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-2px);
    border-color: #009639 !important;
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #1e6031 0%, #009639 50%, #1e6031 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,.05) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title {
    color: #fff;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -.5px;
    margin-bottom: 0;
}

/* ── Survey Type Badge ─────────────────────────────────── */
.survey-type-badge {
    background: linear-gradient(135deg, #009639, #1e6031);
    color: #fff;
    padding: .5rem 1.25rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .3px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,150,57,.25);
}

/* ── Text truncate 2 lines ─────────────────────────────── */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Program Header (dashboard) ────────────────────────── */
.program-header {
    background: linear-gradient(135deg, #009639, #1e6031);
    padding: 2rem 0;
    color: #fff;
    text-align: center;
}
.program-header-college {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .25rem;
}
.program-header-title {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: .5rem;
}
.program-header-meta {
    font-size: 2rem;
}

/* ── Program Tabs ──────────────────────────────────────────── */
.program-tabs {
    border-bottom: none !important;
}
.program-tab-link {
    border: none !important;
    border-radius: 0 !important;
    padding: .85rem 1.25rem !important;
    font-weight: 600;
    color: #555;
    position: relative;
    transition: color .2s;
}
.program-tab-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background: #009639;
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transition: opacity .2s;
}
.program-tab-link:hover {
    color: #009639;
}
.program-tab-link.active {
    color: #009639;
}
.program-tab-link.active::after {
    opacity: 1;
}

/* ── Outlined Button ──────────────────────────────────────── */
.btn-outline-awp {
    border: 1.5px solid #009639;
    color: #009639;
    border-radius: .5rem;
    font-weight: 600;
    transition: all .2s;
}
.btn-outline-awp:hover {
    background-color: #009639;
    color: #fff;
}

/* ── Google Sign-In Button ───────────────────────────────── */
.g_id_signin > div {
    margin: 0 auto;
}

/* ── SweetAlert2 brand overrides ────────────────────────── */
.swal2-popup .swal2-title {
    color: #1e6031;
    font-weight: 800;
}
.swal2-popup .swal2-styled.swal2-confirm {
    border-radius: .5rem !important;
    font-weight: 600 !important;
    padding: .5rem 1.5rem !important;
}
.swal2-popup .swal2-styled.swal2-cancel {
    border-radius: .5rem !important;
    font-weight: 600 !important;
    padding: .5rem 1.5rem !important;
}
.swal2-popup .swal2-validation-message {
    font-size: .8rem;
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
    border-radius: .5rem;
}
.swal2-popup .form-control:focus {
    border-color: #009639;
    box-shadow: 0 0 0 3px rgba(0,150,57,.15);
}

/* ── Loading spinner ────────────────────────────────────── */
.swal2-loading-spinner {
    color: #009639;
}

/* ── Badge brand ─────────────────────────────────────────── */
.badge.bg-awp-primary {
    font-weight: 600;
    letter-spacing: .3px;
}

/* ── Floating Help Button ──────────────────────────────── */
.float-help-btn {
    position: fixed;
    right: 1.25rem;
    top: 1.25rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffd700;
    color: #1e6031;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(255,215,0,.4);
    transition: background-color .2s, transform .2s, box-shadow .2s;
    z-index: 1050;
    text-decoration: none;
}
.float-help-btn:hover {
    background: #ffe44d;
    color: #1e6031;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(255,215,0,.5);
}
.float-help-btn:active {
    transform: translateY(0) scale(1);
}

/* ── Smooth scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }
