/* ============================================
   PMB Shared Styles – MTsN 6 Sumedang
   Matches main site green theme
   ============================================ */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* Design Tokens (same as main site) */
:root {
    --primary: #43A047;
    --primary-dark: #2E7D32;
    --primary-light: #E8F5E9;
    --primary-gradient: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    --accent: #ff7a00;
    --accent-dark: #ff5a1f;
    --text: #333;
    --text-light: #666;
    --white: #ffffff;
    --bg: #f4f6f8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

/* ─── Top Navigation Bar ──────────────────── */
.pmb-topbar {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.pmb-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pmb-topbar .logo-img { height: 40px; width: auto; }
.pmb-topbar .brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
}
.pmb-topbar .home-link {
    margin-left: auto;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
}
.pmb-topbar .home-link:hover { color: var(--primary-dark); }

/* ─── Hero Banner ─────────────────────────── */
.pmb-hero {
    background: var(--primary-gradient);
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.pmb-hero::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -200px; right: -100px;
}
.pmb-hero::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -120px; left: -60px;
}
.pmb-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}
.pmb-hero p {
    font-size: 1.05rem;
    opacity: 0.92;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.pmb-hero .badge-year {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

/* ─── Page Header (sub-pages) ─────────────── */
.pmb-page-header {
    background: var(--primary-gradient);
    padding: 2rem 1.5rem 1.8rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.pmb-page-header::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    top: -180px; right: -80px;
}
.pmb-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.pmb-page-header .breadcrumb {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}
.pmb-page-header .breadcrumb a { color: rgba(255,255,255,0.85); transition: color var(--transition); }
.pmb-page-header .breadcrumb a:hover { color: #fff; }

/* ─── Card Grid (index page) ─────────────── */
.pmb-grid-section {
    max-width: 1000px;
    margin: -2rem auto 2rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 5;
}
.pmb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.pmb-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid rgba(67,160,71,0.08);
    position: relative;
    overflow: hidden;
}
.pmb-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}
.pmb-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.pmb-card:hover::after { opacity: 1; }
.pmb-card-icon {
    width: 60px; height: 60px;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 14px rgba(46,125,50,0.3);
    transition: transform var(--transition);
}
.pmb-card:hover .pmb-card-icon { transform: scale(1.1) rotate(-3deg); }
.pmb-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pmb-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.4rem;
}
.pmb-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}
.pmb-card .arrow {
    color: var(--primary);
    font-size: 0.9rem;
    margin-top: 0.8rem;
    transition: transform var(--transition);
}
.pmb-card:hover .arrow { transform: translateX(6px); }

/* ─── Content Container (sub-pages) ───────── */
.pmb-content {
    max-width: 1000px;
    margin: -1.5rem auto 2rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 5;
    flex: 1;
}
.pmb-panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.pmb-panel-body { padding: 1.5rem; }

/* ─── Table Styles ────────────────────────── */
.pmb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid #e8ece9;
}
.pmb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

/* Header */
.pmb-table thead th {
    background: #43A047;
    color: var(--white);
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    border-bottom: 2px solid #2E7D32;
}
.pmb-table thead th:first-child { border-radius: 12px 0 0 0; }
.pmb-table thead th:last-child { border-radius: 0 12px 0 0; }

/* Body cells */
.pmb-table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid #eef2ef;
    white-space: nowrap;
    background: var(--white);
    transition: all 0.2s ease;
    color: #444;
}

/* Alternating rows */
.pmb-table tbody tr:nth-child(even) td {
    background: #f7faf7;
}

/* Row hover – green accent */
.pmb-table tbody tr {
    transition: all 0.2s ease;
}
.pmb-table tbody tr:hover td {
    background: #E8F5E9 !important;
    color: #1B5E20;
}
.pmb-table tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 #43A047;
}

/* Last row rounded corners */
.pmb-table tbody tr:last-child td:first-child { border-radius: 0 0 0 12px; }
.pmb-table tbody tr:last-child td:last-child { border-radius: 0 0 12px 0; }

/* Freeze first column */
.pmb-table thead th:first-child,
.pmb-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid rgba(67,160,71,0.12);
    font-weight: 600;
    color: #333;
}
.pmb-table thead th:first-child {
    z-index: 15;
    border-right-color: rgba(255,255,255,0.2);
}

/* Table info bar (record count) */
.pmb-table-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 10px 16px;
    background: var(--primary-light);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--primary-dark);
}
.pmb-table-info .count {
    font-weight: 700;
}
.pmb-table-info .count span {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 6px;
}

/* Search input for tables */
.pmb-search {
    width: 100%;
    max-width: 360px;
    padding: 10px 16px 10px 40px;
    border: 2px solid #dce8dd;
    border-radius: 25px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2343A047'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 12px center / 20px;
    margin-bottom: 1rem;
}
.pmb-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67,160,71,0.12);
}
.pmb-search::placeholder {
    color: #aaa;
}

/* Responsive card-view for tables on mobile */
@media (max-width: 768px) {
    .pmb-table-wrapper {
        border: none;
        border-radius: 0;
    }
    .pmb-table.pmb-table-responsive thead { display: none; }
    .pmb-table.pmb-table-responsive,
    .pmb-table.pmb-table-responsive tbody { display: block; }
    .pmb-table.pmb-table-responsive tr {
        display: block;
        margin-bottom: 14px;
        border: 1px solid #dce8dd;
        border-radius: 12px;
        background: var(--white);
        padding: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    /* Green top bar on each card */
    .pmb-table.pmb-table-responsive tr::before {
        content: '';
        display: block;
        height: 4px;
        background: #43A047;
    }
    .pmb-table.pmb-table-responsive tbody td {
        display: grid;
        grid-template-columns: 42% 58%;
        text-align: right;
        padding: 10px 16px;
        border-bottom: 1px solid #f0f2f1;
        white-space: normal;
        font-size: 0.86rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .pmb-table.pmb-table-responsive tbody td:last-child { border-bottom: 0; }
    .pmb-table.pmb-table-responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--primary-dark);
        font-size: 0.8rem;
    }
    .pmb-table.pmb-table-responsive tbody td:first-child {
        position: static;
        border-right: none;
        box-shadow: none !important;
        background: #f7faf7;
        font-weight: 700;
        color: #1B5E20;
        border-radius: 0;
    }
    .pmb-search {
        max-width: 100%;
    }
}

/* ─── Iframe Container ────────────────────── */
.pmb-iframe-wrap {
    width: 100%;
    height: 78vh;
    border: none;
    display: block;
}

/* ─── Loading Spinner ─────────────────────── */
.pmb-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}
.pmb-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pmb-loader-text { color: var(--text-light); font-size: 0.9rem; }

/* Error state */
.pmb-error { color: #d93025; text-align: center; padding: 2rem; font-weight: 500; }

/* Hidden utility */
.hidden { display: none !important; }

/* ─── Footer ──────────────────────────────── */
.pmb-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: auto;
}

/* ─── Countdown (index1) ──────────────────── */
.countdown-circle {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 1.5rem auto;
    position: relative;
    z-index: 1;
}
.pmb-hero .btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--primary-dark);
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 1;
}
.pmb-hero .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

/* ─── Back Button ─────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: color var(--transition), transform var(--transition);
}
.back-link:hover { color: var(--primary-dark); transform: translateX(-4px); }

/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════
   Desktop  : > 1200px  (default styles above)
   Laptop   : 993px – 1200px
   Tablet   : 769px – 992px
   Mobile L : 481px – 768px
   Mobile S : ≤ 480px
   ═══════════════════════════════════════════ */

/* ─── Laptop (≤ 1200px) ───────────────────── */
@media (max-width: 1200px) {
    .pmb-content,
    .pmb-grid-section {
        max-width: 920px;
    }
    .pmb-hero h1 { font-size: 2rem; }
    .pmb-hero p { font-size: 1rem; }
    .pmb-card { padding: 1.6rem 1.3rem; }
    .pmb-card-icon { width: 56px; height: 56px; font-size: 1.4rem; }
}

/* ─── Tablet (≤ 992px) ────────────────────── */
@media (max-width: 992px) {
    .pmb-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .pmb-hero { padding: 3rem 1.5rem 2.5rem; }
    .pmb-hero h1 { font-size: 1.8rem; }
    .pmb-hero p { font-size: 0.95rem; max-width: 500px; }
    .pmb-hero .badge-year { font-size: 0.8rem; padding: 5px 14px; }
    .pmb-page-header { padding: 1.8rem 1.5rem 1.5rem; }
    .pmb-page-header h1 { font-size: 1.4rem; }
    .pmb-content { max-width: 700px; }
    .pmb-grid-section { max-width: 700px; margin-top: -1.8rem; }
    .pmb-card h3 { font-size: 0.95rem; }
    .pmb-card p { font-size: 0.82rem; }
    .pmb-panel-body { padding: 1.25rem; }
    .pmb-iframe-wrap { height: 70vh; }
    .pmb-table thead th { padding: 12px 14px; font-size: 0.76rem; }
    .pmb-table tbody td { padding: 11px 14px; font-size: 0.85rem; }
    .pmb-table-info { font-size: 0.82rem; padding: 8px 14px; }
    .countdown-circle { width: 80px; height: 80px; font-size: 1.8rem; }
    .pmb-hero .btn-cta { padding: 10px 24px; font-size: 0.9rem; }
}

/* ─── Mobile Landscape / Large Phone (≤ 768px) ── */
@media (max-width: 768px) {
    /* Topbar */
    .pmb-topbar-inner { padding: 0.5rem 1rem; }
    .pmb-topbar .logo-img { height: 34px; }
    .pmb-topbar .brand { font-size: 0.95rem; }
    .pmb-topbar .home-link { font-size: 0.82rem; }

    /* Hero */
    .pmb-hero { padding: 2.5rem 1.2rem 2.2rem; }
    .pmb-hero::before { width: 300px; height: 300px; top: -120px; right: -60px; }
    .pmb-hero::after { width: 200px; height: 200px; bottom: -80px; left: -40px; }
    .pmb-hero h1 { font-size: 1.5rem; }
    .pmb-hero p { font-size: 0.9rem; }
    .pmb-hero .badge-year { font-size: 0.78rem; padding: 5px 12px; margin-bottom: 0.8rem; }

    /* Page header */
    .pmb-page-header { padding: 1.5rem 1rem 1.3rem; }
    .pmb-page-header::before { width: 250px; height: 250px; }
    .pmb-page-header h1 { font-size: 1.25rem; }
    .pmb-page-header .breadcrumb { font-size: 0.8rem; margin-top: 0.4rem; }

    /* Cards */
    .pmb-grid-section { margin-top: -1.5rem; padding: 0 1rem; }
    .pmb-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
    .pmb-card { padding: 1.4rem 1.1rem; }
    .pmb-card-icon { width: 50px; height: 50px; font-size: 1.3rem; margin-bottom: 0.8rem; }
    .pmb-card h3 { font-size: 0.9rem; }
    .pmb-card p { font-size: 0.8rem; line-height: 1.4; }
    .pmb-card .arrow { margin-top: 0.6rem; font-size: 0.85rem; }

    /* Content panels */
    .pmb-content { padding: 0 1rem; margin-top: -1.2rem; }
    .pmb-panel-body { padding: 1rem; }
    .back-link { font-size: 0.85rem; }

    /* Iframe */
    .pmb-iframe-wrap { height: 60vh; }

    /* Tables – card-view handled by pmb-table-responsive above */
    .pmb-table-info { flex-direction: column; align-items: flex-start; gap: 6px; }
    .pmb-search { max-width: 100%; font-size: 0.85rem; }

    /* Countdown */
    .countdown-circle { width: 75px; height: 75px; font-size: 1.6rem; margin: 1.2rem auto; }
    .pmb-hero .btn-cta { padding: 10px 22px; font-size: 0.88rem; }

    /* Footer */
    .pmb-footer { padding: 1.2rem 1rem; font-size: 0.78rem; }
}

/* ─── Mobile Portrait / Small Phone (≤ 480px) ── */
@media (max-width: 480px) {
    /* Topbar */
    .pmb-topbar-inner { padding: 0.4rem 0.8rem; gap: 8px; }
    .pmb-topbar .logo-img { height: 30px; }
    .pmb-topbar .brand { font-size: 0.85rem; }
    .pmb-topbar .home-link { font-size: 0.78rem; gap: 4px; }

    /* Hero */
    .pmb-hero { padding: 2rem 1rem 1.8rem; }
    .pmb-hero h1 { font-size: 1.25rem; line-height: 1.3; }
    .pmb-hero p { font-size: 0.85rem; line-height: 1.5; }
    .pmb-hero .badge-year { font-size: 0.72rem; padding: 4px 10px; }

    /* Page header */
    .pmb-page-header { padding: 1.2rem 0.8rem 1rem; }
    .pmb-page-header h1 { font-size: 1.1rem; }
    .pmb-page-header .breadcrumb { font-size: 0.75rem; }

    /* Cards – single column */
    .pmb-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .pmb-grid-section { margin-top: -1.2rem; padding: 0 0.8rem; }
    .pmb-card { 
        padding: 1.2rem 1rem; 
        flex-direction: row; 
        align-items: center; 
        text-align: left; 
        gap: 14px; 
    }
    .pmb-card-icon {
        width: 46px; height: 46px;
        font-size: 1.2rem;
        margin-bottom: 0;
        border-radius: 12px;
        flex-shrink: 0;
    }
    .pmb-card-text {
        text-align: left;
    }
    .pmb-card h3 { font-size: 0.9rem; margin-bottom: 0.2rem; }
    .pmb-card p { font-size: 0.78rem; margin-bottom: 0; }
    .pmb-card .arrow {
        margin-top: 0;
        margin-left: auto;
        font-size: 1rem;
    }
    .pmb-card::after { display: none; }

    /* Content panels */
    .pmb-content { padding: 0 0.8rem; margin-top: -1rem; }
    .pmb-panel { border-radius: 12px; }
    .pmb-panel-body { padding: 0.8rem; }
    .back-link { font-size: 0.82rem; margin-bottom: 0.8rem; }

    /* Iframe */
    .pmb-iframe-wrap { height: 50vh; }

    /* Table mobile card adjustments */
    .pmb-table.pmb-table-responsive tbody td {
        grid-template-columns: 38% 62%;
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .pmb-table.pmb-table-responsive tbody td::before { font-size: 0.76rem; }
    .pmb-table-info { padding: 8px 12px; font-size: 0.78rem; }
    .pmb-search { padding: 9px 14px 9px 36px; font-size: 0.82rem; }

    /* Countdown */
    .countdown-circle { width: 70px; height: 70px; font-size: 1.5rem; margin: 1rem auto; }
    .pmb-hero .btn-cta { padding: 9px 18px; font-size: 0.85rem; gap: 6px; }

    /* Footer */
    .pmb-footer { padding: 1rem 0.8rem; font-size: 0.75rem; }
}

/* ─── Very small screens (≤ 360px) ────────── */
@media (max-width: 360px) {
    .pmb-topbar .brand { display: none; }
    .pmb-hero h1 { font-size: 1.1rem; }
    .pmb-hero p { font-size: 0.8rem; }
    .pmb-page-header h1 { font-size: 1rem; }
    .pmb-card { padding: 1rem 0.8rem; gap: 10px; }
    .pmb-card-icon { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 10px; }
    .pmb-card h3 { font-size: 0.82rem; }
    .pmb-card p { font-size: 0.75rem; }
    .pmb-iframe-wrap { height: 45vh; }
    .pmb-table.pmb-table-responsive tbody td { grid-template-columns: 35% 65%; padding: 7px 10px; }
}

