@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

:root {
    --primary-dark: #0a0e17; /* Slate Black */
    --primary: #027a48;      /* Lighter, Rich Academic Green */
    --primary-light: #0ba35c;
    --accent-gold: #d4af37;   /* Rich Gold */
    --accent-gold-hover: #b89047;
    --grey-bg: #f8f9fa;
    --light-grey: #e9ecef;
    --dark-text: #1e293b;
    --light-text: #ffffff;
    --card-shadow: 0 8px 24px rgba(2, 122, 72, 0.04);
    --hover-shadow: 0 16px 32px rgba(2, 122, 72, 0.08);
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'Cormorant Garamond', serif;
    --font-arabic: 'Amiri', serif;
    --transition-speed: 0.3s;
}

body {
    font-family: var(--font-sans);
    background-color: var(--grey-bg);
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .serif-font {
    font-family: var(--font-serif);
    font-weight: 700;
}

/* Header & Navbar */
.navbar {
    background-color: var(--primary) !important;
    border-bottom: 4px solid var(--accent-gold);
    padding: 1.2rem 0;
}

.navbar-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--light-text) !important;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.navbar-brand small {
    display: block;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 1px;
    margin-top: 2px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all var(--transition-speed);
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--light-text) !important;
    border-bottom: 2px solid var(--accent-gold);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 77, 40, 0.96), rgba(0, 106, 56, 0.88)), 
                radial-gradient(circle at top right, rgba(197, 168, 128, 0.2), transparent 60%);
    color: var(--light-text);
    padding: 6.5rem 0;
    text-align: center;
    border-bottom: 5px solid var(--accent-gold);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--accent-gold) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.05;
    pointer-events: none;
}

.hero-section h1 {
    font-size: 3.2rem;
    color: var(--light-text);
    margin-bottom: 1.2rem;
}

.hero-section h1 span {
    color: var(--accent-gold);
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 850px;
    margin: 0 auto 2.5rem auto;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

/* Page Headers */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--light-text);
    padding: 4.5rem 0;
    border-bottom: 4px solid var(--accent-gold);
    text-align: center;
    position: relative;
}

.page-header h1 {
    color: var(--light-text);
    font-size: 2.6rem;
    margin-bottom: 0.5rem;
}

.page-header h1 span {
    color: var(--accent-gold);
}

/* Buttons */
.btn-gold {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    font-weight: 600;
    border: 2px solid var(--accent-gold);
    padding: 0.7rem 1.8rem;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.btn-gold:hover {
    background-color: transparent;
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.btn-outline-gold {
    background-color: transparent;
    color: var(--accent-gold);
    font-weight: 600;
    border: 2px solid var(--accent-gold);
    padding: 0.7rem 1.8rem;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.btn-outline-gold:hover {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-emerald {
    background-color: var(--primary);
    color: var(--light-text);
    border: 2px solid var(--primary);
    padding: 0.7rem 1.8rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-emerald:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--light-text);
    transform: translateY(-2px);
}

/* Cards */
.premium-card {
    background: #ffffff;
    border: 1px solid rgba(0, 106, 56, 0.08);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease-in-out;
    overflow: hidden;
    height: 100%;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(197, 168, 128, 0.4);
}

.card-accent-border {
    border-top: 4px solid var(--accent-gold);
}

.card-emerald-border {
    border-top: 4px solid var(--primary);
}

/* Section Titles */
.section-title-container {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.3rem;
    color: var(--primary-dark);
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-gold);
    margin: 8px auto 0 auto;
    border-radius: 2px;
}

/* History Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gold);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::after {
    content: '';
    display: table;
    clear: both;
}

.timeline-img {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: 4px solid var(--accent-gold);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.timeline-content {
    width: 45%;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    position: relative;
}

.timeline-item:nth-child(even) .timeline-content {
    float: right;
}

.timeline-item:nth-child(odd) .timeline-content {
    float: left;
    text-align: right;
}

.timeline-date {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    .timeline-img {
        left: 20px;
        transform: none;
    }
    .timeline-content {
        width: calc(100% - 60px);
        float: right !important;
        text-align: left !important;
        margin-left: 60px;
    }
}

/* Statistics Counters */
.stat-counter-box {
    background: #ffffff;
    border-bottom: 4px solid var(--primary);
    border-radius: 8px;
    padding: 2rem 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

.stat-counter-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Forms */
.form-control, .form-select {
    border: 1px solid rgba(0, 106, 56, 0.15);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 106, 56, 0.15);
}

.floating-card-form {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: var(--hover-shadow);
    padding: 2.5rem;
    border: 1px solid rgba(0, 106, 56, 0.05);
}

/* Footer */
footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 4.5rem 0 2rem 0;
    margin-top: auto;
    border-top: 5px solid var(--accent-gold);
}

footer h5 {
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: var(--accent-gold);
}

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

/* Admin Styles */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background-color: var(--primary-dark);
    color: var(--light-text);
    border-right: 3px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-header h4 {
    font-family: var(--font-serif);
    color: var(--accent-gold);
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.admin-sidebar-menu {
    flex-grow: 1;
    padding: 1.5rem 0;
}

.admin-nav-link {
    padding: 0.85rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: all var(--transition-speed);
    font-weight: 500;
}

.admin-nav-link:hover, .admin-nav-link.active {
    background-color: rgba(0, 106, 56, 0.3);
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
}

.admin-nav-link i {
    width: 25px;
    margin-right: 12px;
    font-size: 1.15rem;
    text-align: center;
}

.admin-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-content {
    flex-grow: 1;
    background-color: #f8fafc;
    padding: 2.5rem;
    overflow-y: auto;
}

.admin-card {
    background: #ffffff;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
}

.admin-table th {
    background-color: rgba(0, 106, 56, 0.05);
    color: var(--primary-dark);
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 106, 56, 0.1);
}

.admin-table td {
    vertical-align: middle;
}

/* Stat Cards */
.stat-card {
    border-radius: 8px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.stat-card-emerald {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.stat-card-gold {
    background: linear-gradient(135deg, #d4af37, #aa841c);
}

.stat-card-teal {
    background: linear-gradient(135deg, #10b981, #065f46);
}

.stat-card-blue {
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
}

.stat-card-info {
    position: relative;
    z-index: 2;
}

.stat-card-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.stat-card-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.15;
    z-index: 1;
    transform: rotate(-15deg);
}

/* Profile cards layout */
.faculty-section-title {
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-family: var(--font-serif);
}

.faculty-badge {
    background-color: rgba(0, 106, 56, 0.1);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Phase items expansion */
.phase-card {
    border-left: 5px solid var(--accent-gold);
}
.phase-card.active {
    border-left-color: var(--primary);
}

/* ── Board of Trustees Layout ─────────────────────────────────────────── */
.trustees-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto;
}

.trustee-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--accent-gold);
    transition: all var(--transition-speed);
}

.trustee-row:hover {
    box-shadow: var(--hover-shadow);
    transform: translateX(4px);
}

.trustee-photo-wrap {
    flex-shrink: 0;
}

.trustee-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-gold);
    display: block;
}

.trustee-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 3px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 1.6rem;
}

.trustee-info {
    flex-grow: 1;
    min-width: 0;
}

.trustee-name {
    font-size: 1.15rem;
    color: var(--dark-text);
    margin: 0 0 0.2rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trustee-position {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.2px;
}

/* ── Quran Competition Cards ──────────────────────────────────────────── */
.quran-competition-heading {
    text-align: center;
    margin-bottom: 1rem;
}

/* ── Admin Media Queries ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .admin-wrapper {
        /* sidebar handled via JS overlay */
    }
    .admin-sidebar {
        width: 280px;
    }
    .admin-content {
        padding: 1.5rem;
    }
}

/* ── Public Mobile Responsiveness ─────────────────────────────────────── */
@media (max-width: 767.98px) {
    .hero-section h1 { font-size: 2.1rem; }
    .section-title   { font-size: 1.75rem; }
    .page-header h1  { font-size: 1.8rem; }
    .page-header     { padding: 3rem 0; }

    .trustee-name {
        font-size: 1rem;
        white-space: normal;
    }
    .trustee-row {
        padding: 0.85rem 1rem;
        gap: 1rem;
    }
    .trustee-photo, .trustee-photo-placeholder {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .stat-counter-box { padding: 1.5rem 1rem; }
    .hero-section     { padding: 4rem 0; }
    .hero-section p   { font-size: 1rem; }
    .btn-gold, .btn-emerald, .btn-outline-gold { padding: 0.55rem 1.2rem; }
}

/* Arabic Text Styles */
.arabic-text {
    font-family: var(--font-arabic);
    direction: rtl;
    unicode-bidi: embed;
}
.arabic-brand {
    font-family: var(--font-arabic) !important;
}


/* ── PREMIUM ADMIN STYLING & MODAL SUITE ───────────────────────────────── */
.admin-card {
    border: 1px solid rgba(0, 69, 36, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 43, 23, 0.05);
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.admin-card:hover {
    box-shadow: 0 6px 22px rgba(0, 43, 23, 0.08);
}

.admin-table {
    vertical-align: middle;
}

.admin-table thead th {
    background-color: #f7f9f8;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #e1e8e4;
    padding: 0.85rem 0.75rem;
}

.admin-table tbody td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #edf1ee;
    font-size: 0.88rem;
}

.admin-table tbody tr:hover {
    background-color: rgba(0, 106, 56, 0.025);
}

.btn-add-action {
    background: linear-gradient(135deg, #006a38 0%, #004d26 100%);
    color: #ffffff !important;
    border: 1px solid #c5a880;
    padding: 0.5rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 106, 56, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.btn-add-action:hover {
    background: linear-gradient(135deg, #00502a 0%, #00361a 100%);
    box-shadow: 0 4px 12px rgba(0, 106, 56, 0.3);
    transform: translateY(-1px);
}

/* Premium Modal Customization */
.modal-content {
    border-radius: 12px;
    border: 1px solid rgba(197, 168, 128, 0.35);
    box-shadow: 0 20px 45px rgba(0, 43, 23, 0.25);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #004524 0%, #006a38 100%) !important;
    color: #ffffff !important;
    border-bottom: 2px solid var(--accent-gold);
    padding: 1.1rem 1.5rem;
}

.modal-header .modal-title,
.modal-header h5 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff !important;
}

.modal-header .modal-title i,
.modal-header h5 i {
    color: var(--accent-gold) !important;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.85;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    background-color: #ffffff;
}

.modal-footer {
    background-color: #f8faf9;
    border-top: 1px solid #e7ede9;
    padding: 0.9rem 1.5rem;
}

/* Form inputs premium styling */
.admin-modal label,
.admin-card label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a5568;
    margin-bottom: 0.35rem;
}

.admin-modal .form-control,
.admin-modal .form-select,
.admin-card .form-control,
.admin-card .form-select {
    font-size: 0.88rem;
    border-radius: 6px;
    border: 1px solid #d2dacf;
    padding: 0.55rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-modal .form-control:focus,
.admin-modal .form-select:focus,
.admin-card .form-control:focus,
.admin-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 106, 56, 0.15);
}

.admin-modal .optional-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #718096;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ACHIEVEMENT RANKING BADGES (1st - Gold, 2nd - Silver, 3rd - Bronze, 4th/5th - Gray)
   ══════════════════════════════════════════════════════════════════════════════ */
.badge-ranking-gold {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%) !important;
    color: #ffffff !important;
    border: 1px solid #c5a880 !important;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.35);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-ranking-silver {
    background: linear-gradient(135deg, #9aa5b1 0%, #7b8794 100%) !important;
    color: #ffffff !important;
    border: 1px solid #cbd2d9 !important;
    box-shadow: 0 2px 6px rgba(123, 135, 148, 0.35);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-ranking-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%) !important;
    color: #ffffff !important;
    border: 1px solid #b36b28 !important;
    box-shadow: 0 2px 6px rgba(160, 82, 45, 0.35);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-ranking-white {
    background-color: #ffffff !important;
    color: #2d3748 !important;
    border: 1.5px solid #cbd5e0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   HIDE NUMBER INPUT SPINNERS (UP/DOWN ARROW BUTTONS) ACROSS BROWSERS
   ══════════════════════════════════════════════════════════════════════════════ */
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
