/* ===========================================================
   Creativity Home School – Main Stylesheet
   Direction: RTL  |  Framework: Bootstrap 5 RTL
   =========================================================== */

/* ── CSS Variables ── */
:root {
    --primary:        #8e323d;
    --primary-dark:   #495057;
    --primary-light:  #faeaec;
    --gold:           #C9956A;
    --gold-dark:      #A07040;
    --gold-light:     #fdf2e6;
    --text-dark:      #1c2833;
    --text-muted:     #6c7a82;
    --bg-light:       #faf7f7;
    --border-color:   #f0d8de;
    --white:          #ffffff;
    --shadow-sm:      0 2px 8px rgba(142,50,61,.10);
    --shadow-md:      0 4px 20px rgba(142,50,61,.15);
    --radius:         10px;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.8;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Top Bar ── */
.top-bar {
    background: var(--primary-dark);
    color: #f0d8de;
    font-size: .82rem;
    padding: .35rem 0;
}
.top-bar a { color: #f0d8de; }
.top-bar a:hover { color: var(--gold); }
.top-bar .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    margin-inline-start: .3rem;
    font-size: .78rem;
    transition: background .2s;
}
.top-bar .social-icons a:hover { background: var(--gold); color: var(--primary-dark); }

/* ── Navbar ── */
.main-navbar {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: .6rem 0;
    position: sticky; top: 0; z-index: 1030;
}
.main-navbar .navbar-brand img {
    height: 65px;
}
.main-navbar .nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: .95rem;
    padding: .5rem .9rem !important;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
    display: flex; align-items: center; gap: .4rem;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary) !important;
}
.main-navbar .nav-link img.menu-icon {
    width: 22px; height: 22px; object-fit: contain;
}
.main-navbar .nav-link i.menu-icon {
    font-size: 1rem;
    color: var(--primary);
    opacity: .85;
    transition: color .2s, opacity .2s;
    vertical-align: -.1em;
}
.main-navbar .nav-link:hover i.menu-icon,
.main-navbar .nav-link.active i.menu-icon {
    color: var(--primary);
    opacity: 1;
}
.main-navbar .dropdown-icon {
    font-size: .95rem;
    color: var(--gold-dark);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.main-navbar .dropdown-item:hover .dropdown-icon {
    color: var(--primary);
}
.main-navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    min-width: 220px;
}
.main-navbar .dropdown-item {
    font-weight: 500;
    padding: .6rem 1.2rem;
    display: flex; align-items: center; gap: .5rem;
}
.main-navbar .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

/* ── Hero Section (Home) ── */
.hero-section {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
}
/* Animated background layer – Ken Burns slow zoom */
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    animation: heroZoom 14s ease-in-out infinite alternate;
    will-change: transform;
    z-index: 0;
}
@keyframes heroZoom {
    from { transform: scale(1.12) translateX(0); }
    to   { transform: scale(1.0)  translateX(-1.5%); }
}
/* Semi-transparent gradient overlay – lets image shine through */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(100,22,32,.58) 0%,
        rgba(50,28,18,.46)  55%,
        rgba(25,18,38,.42)  100%
    );
    z-index: 1;
}
/* Floating colour orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
.orb-1 {
    width: 300px; height: 300px;
    top: -90px; left: -90px;
    background: radial-gradient(circle, rgba(201,149,106,.30) 0%, transparent 70%);
    animation: orbFloat 7s ease-in-out infinite;
}
.orb-2 {
    width: 380px; height: 380px;
    bottom: -130px; right: -110px;
    background: radial-gradient(circle, rgba(142,50,61,.28) 0%, transparent 70%);
    animation: orbFloat 9s ease-in-out infinite reverse;
}
.orb-3 {
    width: 180px; height: 180px;
    top: 35%; left: 52%;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
    animation: orbFloat 5s ease-in-out 1s infinite;
}
@keyframes orbFloat {
    0%,100% { transform: translateY(0)    scale(1);    }
    50%     { transform: translateY(-22px) scale(1.06); }
}
/* Content entrance animations */
.hero-logo     { animation: heroFadeDown .85s cubic-bezier(.22,1,.36,1)       both; }
.hero-title    { animation: heroFadeUp   .85s cubic-bezier(.22,1,.36,1) .20s  both;
                 text-shadow: 0 3px 28px rgba(0,0,0,.50); }
.hero-subtitle { animation: heroFadeUp   .85s cubic-bezier(.22,1,.36,1) .38s  both;
                 color: #f5e4cc; }
.hero-quote    { animation: heroFadeUp   .85s cubic-bezier(.22,1,.36,1) .52s  both;
                 color: #fdf5ec;
                 background: rgba(255,255,255,.12) !important;
                 backdrop-filter: blur(6px);
                 border: 1px solid rgba(255,255,255,.20) !important; }
.hero-btns     { animation: heroFadeUp   .85s cubic-bezier(.22,1,.36,1) .66s  both; }
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes heroFadeDown {
    from { opacity: 0; transform: translateY(-24px) scale(.88); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

/* ── Hero / Page Header ── */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url('/images/pattern-bg.png') repeat;
    opacity: .06;
}
.page-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: .4rem; }
.page-hero p  { font-size: 1rem; opacity: .9; }
.breadcrumb-item a { color: var(--gold-light); }
.breadcrumb-item.active { color: #fff; }

/* ── Section Title ── */
.section-title {
    position: relative;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--primary-dark);
    padding-bottom: .75rem;
    margin-bottom: 1.8rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 60px; height: 4px;
    background: var(--gold);
    border-radius: 2px;
}

/* ── Cards ── */
.post-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform .25s, box-shadow .25s;
    overflow: hidden;
    height: 100%;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.post-card .card-img-top {
    height: 190px;
    object-fit: cover;
    width: 100%;
}
.post-card .card-body { padding: 1.2rem; }
.post-card .card-title { font-weight: 700; font-size: 1rem; color: var(--text-dark); }
.post-card .card-text  { color: var(--text-muted); font-size: .88rem; }
.post-card .btn-read-more {
    background: var(--primary);
    color: var(--white);
    border-radius: 25px;
    padding: .35rem 1rem;
    font-size: .85rem;
    font-weight: 600;
}
.post-card .btn-read-more:hover { background: var(--primary-dark); color: var(--white); }

/* ── Tabs ── */
.grade-tabs .nav-link {
    background: var(--white);
    border: 2px solid var(--border-color) !important;
    border-radius: 25px !important;
    color: var(--text-dark);
    font-weight: 600;
    padding: .45rem 1.1rem;
    transition: all .2s;
}
.grade-tabs .nav-link.active,
.grade-tabs .nav-link:hover {
    background: var(--primary);
    border-color: var(--primary) !important;
    color: var(--white);
}
.subject-tabs .nav-link {
    background: var(--white);
    border: 2px solid var(--border-color) !important;
    border-radius: 6px !important;
    color: var(--text-dark);
    font-weight: 600;
    padding: .4rem 1rem;
}
.subject-tabs .nav-link.active,
.subject-tabs .nav-link:hover {
    background: var(--gold);
    border-color: var(--gold) !important;
    color: var(--white);
}

/* ── Honor Board ── */
.honor-section-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}
.honor-section-header {
    background: linear-gradient(to left, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 1rem 1.5rem;
    font-weight: 800;
    font-size: 1.15rem;
}
.honor-section-header.gold {
    background: linear-gradient(to left, var(--gold), var(--gold-dark));
}
.honor-section-header.teal {
    background: linear-gradient(to left, #00796b, #004d4b);
}
.honor-post-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.honor-post-item:last-child { border-bottom: none; }
.honor-post-item img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-sm);
}
.honor-post-content { color: var(--text-dark); line-height: 1.9; }

/* ── Results Page ── */
.grade-card-result {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    padding: 2rem 1rem;
    cursor: pointer;
    transition: all .25s;
}
.grade-card-result:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.grade-card-result .grade-icon {
    width: 60px; height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .8rem;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 800;
}
.results-table thead { background: var(--primary); color: var(--white); }
.results-table .pass   { background: #e8f5e9; color: #2e7d32; font-weight: 700; }
.results-table .fail   { background: #fce4ec; color: #c62828; font-weight: 700; }

/* ── Forms ── */
.form-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}
.form-label { font-weight: 600; color: var(--text-dark); }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(142,50,61,.15);
}
.btn-primary-custom {
    background: var(--primary);
    border: none;
    color: var(--white);
    font-weight: 700;
    padding: .7rem 2.5rem;
    border-radius: 30px;
    font-size: 1rem;
    transition: background .2s;
}
.btn-primary-custom:hover { background: var(--primary-dark); color: var(--white); }
.btn-gold {
    background: var(--gold);
    border: none;
    color: var(--white);
    font-weight: 700;
    padding: .65rem 2rem;
    border-radius: 30px;
    transition: background .2s;
}
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.captcha-img { border-radius: 6px; cursor: pointer; border: 2px solid var(--border-color); }

/* ── Footer ── */
.site-footer {
    background: var(--primary-dark);
    color: #f0d8de;
    padding: 3rem 0 1.5rem;
}
.site-footer h5 { color: var(--white); font-weight: 700; margin-bottom: 1rem; }
.site-footer a  { color: #f0d8de; font-size: .9rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    font-size: .82rem;
    text-align: center;
    color: #c48090;
}
.site-footer .social-links a {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    margin-inline-end: .4rem;
    color: #fff;
    font-size: .9rem;
    transition: background .2s;
}
.site-footer .social-links a:hover { background: var(--gold); }

/* ── Admin Layout ── */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--primary-dark);
    color: #f0d8de;
    flex-shrink: 0;
}
.admin-sidebar .brand { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-sidebar .brand img { height: 50px; }
.admin-sidebar .nav-link {
    color: #f0d8de !important;
    padding: .65rem 1.3rem;
    font-weight: 600;
    display: flex; align-items: center; gap: .6rem;
    border-radius: 6px;
    margin: .1rem .5rem;
    transition: background .2s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff !important; }
.admin-sidebar .nav-section {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    padding: .8rem 1.3rem .2rem;
}
/* Collapsible parent link */
.admin-sidebar .nav-parent { justify-content: flex-start; }
.admin-sidebar .nav-parent .collapse-arrow {
    transition: transform .25s;
    margin-right: auto !important;
    margin-left: 0 !important;
    font-size: .8rem;
    opacity: .7;
}
.admin-sidebar .nav-parent:not(.collapsed) .collapse-arrow { transform: rotate(180deg); }
/* Sub-links */
.admin-sidebar .nav-sub-link {
    color: rgba(240,216,222,.8) !important;
    padding: .5rem 1rem .5rem 2.4rem;
    font-size: .88rem;
    font-weight: 500;
    border-radius: 6px;
    margin: .05rem .5rem;
}
.admin-sidebar .nav-sub-link:hover,
.admin-sidebar .nav-sub-link.active {
    background: rgba(255,255,255,.1);
    color: #fff !important;
}
.admin-main { flex: 1; min-height: 100vh; background: var(--bg-light); }
.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: .75rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.admin-content { padding: 2rem 1.5rem; }
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--primary);
}
.stat-card.gold  { border-right-color: var(--gold); }
.stat-card.teal  { border-right-color: #00796b; }
.stat-card.red   { border-right-color: #c62828; }
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.stat-card .stat-lbl { font-size: .85rem; color: var(--text-muted); }

/* ── Utility ── */
.text-primary-custom { color: var(--primary) !important; }
.text-gold { color: var(--gold) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-gold { background: var(--gold) !important; }
.border-primary-custom { border-color: var(--primary) !important; }
.border-gold  { border-color: var(--gold) !important; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .admin-sidebar { width: 100%; min-height: auto; }
    .page-hero h1  { font-size: 1.5rem; }
}
