/* ============================================================
   MTs Ahmad Yani Jabung — Base Style v3
   Semua warna & font dari theme.php (CSS variables)
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color .25s; }
a:hover { color: var(--secondary); }
img { max-width: 100%; height: auto; display: block; }

/* ============ NAVBAR ============ */
.navbar {
    padding: .6rem 0;
    background: var(--primary) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    border-bottom: 3px solid var(--secondary);
}
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.navbar-brand img {
    height: 40px;
    width: auto;
    background: #fff;
    padding: 3px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.navbar-brand::before {
    content: "🕌";
    font-size: 1.35rem;
    display: none;
}
.navbar-brand:not(:has(img))::before { display: inline-block; }

.navbar .nav-link {
    color: rgba(255,255,255,.9) !important;
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .85rem !important;
    border-radius: var(--radius-sm);
    transition: all .2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.12);
}
.navbar .nav-link.btn-login {
    background: var(--secondary);
    color: var(--primary-dark) !important;
    font-weight: 700;
    margin-left: .5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.navbar .nav-link.btn-login:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
}

.navbar-toggler {
    border: 1.5px solid rgba(255,255,255,.4);
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
}
.navbar-toggler:focus { box-shadow: 0 0 0 .15rem rgba(255,255,255,.3); }

.dropdown-menu {
    border: 1px solid var(--cream);
    box-shadow: 0 8px 28px rgba(0,0,0,.1);
    border-radius: var(--radius-sm);
    padding: .5rem;
    margin-top: .5rem;
    min-width: 240px;
}
.dropdown-item {
    padding: .55rem .85rem;
    border-radius: 6px;
    font-size: .88rem;
    color: var(--text);
}
.dropdown-item:hover { background: var(--cream); color: var(--primary); }

/* ============ HERO ============ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--accent-teal) 100%);
    color: #fff;
    padding: var(--hero-padding) 0 calc(var(--hero-padding) + 1rem);
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid var(--secondary);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,.08) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3Cpath d='M40 15 L65 40 L40 65 L15 40 Z'/%3E%3Ccircle cx='40' cy='40' r='10'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 {
    color: #fff;
    font-size: clamp(1.9rem, 4.5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -.5px;
    text-shadow: 0 2px 20px rgba(0,0,0,.15);
}
.hero p {
    font-size: clamp(.95rem, 1.6vw, 1.2rem);
    opacity: .95;
    margin-bottom: .5rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.hero .badge-accent {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    color: var(--primary-dark);
    padding: .45rem 1.15rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: .82rem;
    margin-bottom: 1.2rem;
    letter-spacing: .3px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.hero .btn-outline-light {
    border: 1.5px solid rgba(255,255,255,.7);
    color: #fff;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
}
.hero .btn-outline-light:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

/* ============ PAGE HEADER ============ */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-teal) 100%);
    color: #fff;
    padding: 3rem 0 3.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--secondary);
}
.page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3C/g%3E%3C/svg%3E");
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { color: #fff; font-size: clamp(1.4rem, 3.2vw, 2rem); margin-bottom: .4rem; }
.page-header p { color: rgba(255,255,255,.85); margin: 0; font-size: .95rem; }

/* ============ CARD ============ */
.card {
    border: 1px solid var(--cream);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: transform .3s, box-shadow .3s;
    overflow: hidden;
    background: var(--bg);
    height: 100%;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,.10);
    border-color: var(--secondary);
}
.card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform .5s;
}
.card:hover .card-img-top { transform: scale(1.05); }
.card-body { padding: 1.35rem; }
.card-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .5rem;
    line-height: 1.4;
}
.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: #fff !important;
    font-weight: 600;
    border: none;
    padding: 1rem 1.35rem;
    font-size: .95rem;
}

/* ============ SECTION TITLE ============ */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2.2rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}
.section-title::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    border-radius: 2px;
    margin-top: .6rem;
}

/* ============ BUTTONS ============ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: .6rem 1.3rem;
    font-size: .9rem;
    transition: all .25s;
    border-width: 1.5px;
}
.btn-success {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: transparent;
    transform: translateY(-2px);
    color: #fff;
}
.btn-outline-success {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}
.btn-outline-success:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}
.btn-accent {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-color: transparent;
    color: var(--primary-dark);
    font-weight: 700;
}
.btn-accent:hover {
    background: linear-gradient(135deg, var(--secondary), var(--secondary));
    border-color: transparent;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============ TABLES ============ */
.table-responsive-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.table {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    font-size: .9rem;
    margin-bottom: 0;
}
.table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: #fff;
}
.table thead th {
    font-weight: 600;
    border: none;
    padding: .9rem 1rem;
    font-size: .8rem;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.table tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    border-color: var(--cream);
    background: var(--bg);
}
.table tbody tr:nth-child(even) td { background: rgba(0,0,0,.015); }
.table tbody tr:hover td { background: var(--cream); }

/* ============ LIST GROUP ============ */
.list-group-item {
    border-color: var(--cream);
    padding: .95rem 1.2rem;
    background: var(--bg);
}
.list-group-item:hover { background: var(--cream); }
.list-group-item strong { color: var(--primary); }

/* ============ CONTENT ============ */
.content { font-size: 1rem; line-height: 1.85; color: var(--text); }
.content p { margin-bottom: 1rem; }
article.detail img { border-radius: var(--radius); margin: 1rem 0; box-shadow: 0 4px 14px rgba(0,0,0,.08); }

/* ============ GTK ============ */
.gtk-card .card-img-top { height: 250px; object-fit: cover; object-position: center top; }
.gtk-card .card-body { text-align: center; }
.gtk-card strong { display: block; font-size: .95rem; margin-bottom: .25rem; color: var(--primary); font-weight: 600; }
.gtk-card small { color: #6b7280; font-size: .82rem; }

/* ============ ALERTS & BADGES ============ */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 1rem 1.25rem;
    font-size: .92rem;
    border-left: 4px solid;
}
.alert-info { background: #e0f2fe; border-color: #0284c7; color: #075985; }
.alert-success { background: #dcfce7; border-color: var(--primary); color: #14532d; }
.alert-warning { background: #fef3c7; border-color: var(--secondary); color: #78350f; }
.alert-danger { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
.badge {
    font-weight: 600;
    padding: .4rem .75rem;
    border-radius: 6px;
    font-size: .75rem;
}
.badge.bg-success { background: var(--primary) !important; }

/* ============ FOOTER ============ */
footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-teal) 100%) !important;
    color: rgba(255,255,255,.85) !important;
    padding: 3.5rem 0 1.5rem !important;
    margin-top: 4rem !important;
    position: relative;
    border-top: 4px solid var(--secondary);
}
footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
footer > * { position: relative; z-index: 1; }
footer h5 { color: var(--secondary-light); font-weight: 600; margin-bottom: 1.1rem; font-size: 1rem; }
footer a { color: rgba(255,255,255,.8); }
footer a:hover { color: var(--secondary-light); }
footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 1.5rem;
    margin-top: 2rem;
    font-size: .85rem;
    text-align: center;
    color: rgba(255,255,255,.7);
}

/* ============ PAGINATION ============ */
.pagination-wrap { display: flex; gap: .5rem; flex-wrap: wrap; }
.pagination-wrap .btn { min-width: 44px; padding: .5rem .85rem; }

/* ============ ANIMASI ============ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s ease-out, transform .7s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============ UTILITY ============ */
.text-balance { text-wrap: balance; }
.bg-cream { background: var(--cream); }
.bg-gradient-madrasah { background: linear-gradient(135deg, var(--primary), var(--accent-teal)); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .hero { padding: calc(var(--hero-padding) * .8) 0 calc(var(--hero-padding) * .8); }
    .card-img-top { height: 200px; }
}

@media (max-width: 992px) {
    .hero { padding: calc(var(--hero-padding) * .6) 0 calc(var(--hero-padding) * .65); }
    .hero h1 { font-size: 2rem; }
    .navbar .nav-link.btn-login { margin: .5rem 0 0; display: inline-block; }
    .section-title { font-size: 1.35rem; }
}

@media (max-width: 768px) {
    body { font-size: calc(var(--font-size) - .5px); }
    .navbar-collapse {
        margin-top: .75rem;
        background: var(--primary-dark);
        border-radius: var(--radius-sm);
        padding: .75rem;
        max-height: 80vh;
        overflow-y: auto;
    }
    .navbar .nav-link { padding: .7rem .9rem !important; }
    .hero { padding: 2.5rem 0 3rem; text-align: center; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: .95rem; }
    .page-header { padding: 2rem 0 2.5rem; }
    .page-header h1 { font-size: 1.35rem; }
    .section-title { font-size: 1.25rem; margin-bottom: 1.5rem; }
    .section-title::after { width: 50px; height: 3px; }
    .card-img-top { height: 190px; }
    .gtk-card .card-img-top { height: 220px; }
    .table { font-size: .82rem; }
    .table thead th { padding: .65rem .7rem; font-size: .72rem; }
    .table tbody td { padding: .65rem .7rem; }
    footer { padding: 2.25rem 0 1rem !important; text-align: center; }
    footer .row > div { margin-bottom: 1.75rem; }
    .btn { font-size: .88rem; padding: .55rem 1rem; }
}

@media (max-width: 480px) {
    body { font-size: calc(var(--font-size) - 1px); line-height: 1.65; }
    .hero { padding: 2rem 0 2.5rem; }
    .hero h1 { font-size: 1.4rem; }
    .hero .badge-accent { font-size: .72rem; padding: .35rem .9rem; }
    .hero .btn { display: block; width: 100%; margin: .35rem 0; }
    .page-header { padding: 1.6rem 0 2rem; }
    .page-header h1 { font-size: 1.2rem; }
    .page-header p { font-size: .85rem; }
    .container { padding-left: 1rem; padding-right: 1rem; }
    .card { border-radius: var(--radius-sm); }
    .card-body { padding: 1.1rem; }
    .card-title { font-size: .95rem; }
    .card-img-top { height: 170px; }
    .section-title { font-size: 1.15rem; }
    .table { font-size: .75rem; }
    .table thead th { padding: .55rem .45rem; font-size: .65rem; }
    .table tbody td { padding: .55rem .45rem; }
    footer { font-size: .85rem; padding: 1.75rem 0 .75rem !important; }
    footer h5 { font-size: .95rem; }
    .btn { font-size: .86rem; padding: .55rem .9rem; }
}

@media (max-width: 360px) {
    .hero h1 { font-size: 1.25rem; }
    .hero .badge-accent { font-size: .68rem; }
    .card-body { padding: .9rem; }
}

@media print {
    .navbar, footer, .btn, .pagination-wrap { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .card, .table { box-shadow: none; border: 1px solid #ccc; }
}