/* Global Responsive & Mobile Ergonomics Constraints */
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    touch-action: pan-y;
}

/* Mobile Bottom Navigation Bar Ergonomics (5-Item Balanced Grid) */
#mobileBottomNav {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box;
    contain: layout paint;
}

#mobileBottomNav > * {
    min-width: 0;
}

.bg-islamic-pattern {
    background-color: #f1f7f2;
    background-image: linear-gradient(rgba(241, 247, 242, 0.95), rgba(241, 247, 242, 0.95)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%231a6b3c' fill-opacity='0.08'%3E%3Cpath d='M60 60l60-60v120L60 60zM0 0l60 60L0 120V0z'/%3E%3Cpath d='M60 60l60 60H0L60 60zm0 0L0 60l60-60z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 120px;
}
.dark-islamic-pattern {
    background-color: #0b3d21;
    background-image: linear-gradient(rgba(11, 61, 33, 0.95), rgba(11, 61, 33, 0.95)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.08'%3E%3Cpath d='M60 60l60-60v120L60 60zM0 0l60 60L0 120V0z'/%3E%3Cpath d='M60 60l60 60H0L60 60zm0 0L0 60l60-60z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 120px;
}
.glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.btn-spring {
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-spring:active {
    transform: scale(0.95);
}
/* Custom Ticker Animation */
@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}
.animate-ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 32s linear infinite;
}
.animate-ticker:hover {
    animation-play-state: paused;
}
[dir="rtl"] {
    font-family: 'Cairo', 'Amiri', serif;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Rich Editor Visual Surface */
.editor-surface:empty:before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

/* Organigram Tree Connector Lines */
.org-connector-down {
    position: relative;
}
.org-connector-down::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    width: 2px;
    height: 16px;
    background-color: #cbd5e1;
    transform: translateX(-50%);
}
.org-connector-up {
    position: relative;
}
.org-connector-up::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    width: 2px;
    height: 16px;
    background-color: #cbd5e1;
    transform: translateX(-50%);
}

/* Print Card for PPDB Bukti Pendaftaran */
@media print {
    body * {
        visibility: hidden;
    }
    #printSection, #printSection * {
        visibility: visible;
    }
    #printSection {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

/* ============================================================
   Native Mobile App Feel & Touch Ergonomics (iOS / Android)
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    overscroll-behavior-y: contain;
}

/* Safe areas for notched displays & home bars */
.pb-safe {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4.5rem);
}
.bottom-safe {
    bottom: env(safe-area-inset-bottom, 0px);
}
.pt-safe {
    padding-top: env(safe-area-inset-top, 0px);
}

/* Touch active scale effect with physics spring */
.touch-press {
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, opacity 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}
.touch-press:active {
    transform: scale(0.94);
}

/* Horizontal Snap Scroll for Category Pills & Mobile Cards */
.snap-pills, .snap-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.snap-pills::-webkit-scrollbar, .snap-cards::-webkit-scrollbar, .scrollbar-none::-webkit-scrollbar {
    display: none;
}
.snap-pills > *, .snap-cards > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Mobile Bottom Sheet Animations */
@keyframes sheetSlideUp {
    0% {
        transform: translateY(100%);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes sheetSlideDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.modal-animate-sheet {
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.modal-animate-sheet-exit {
    animation: sheetSlideDown 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
    will-change: transform, opacity;
}

@media (min-width: 768px) {
    .modal-animate-sheet {
        animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

/* Mobile Sheet Drag Handle */
.sheet-drag-handle {
    width: 40px;
    height: 5px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    margin: 4px auto 14px auto;
    cursor: grab;
    transition: background-color 0.2s;
}
.sheet-drag-handle:active {
    background-color: #94a3b8;
    cursor: grabbing;
}

/* Mobile Bottom Bar Active Glow & Indicator */
.nav-tab-active {
    color: #1a6b3c !important;
    position: relative;
}
.nav-tab-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 18px;
    height: 3px;
    background: #1a6b3c;
    border-radius: 9999px;
    transition: all 0.25s ease;
}

.active-nav-link {
    color: #1a6b3c !important;
    background-color: #ecfdf5 !important;
}

/* Intersection Observer Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent text zoom on mobile inputs */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}


.news-item {
    position: relative;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease;
}

.news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a6b3c 0%, #2d8f54 50%, #d4af37 100%);
    opacity: 0;
    transform: scaleX(0.7);
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -4px rgba(13, 74, 40, 0.08), 
                0 6px 12px -2px rgba(0, 0, 0, 0.04), 
                0 0 0 1px rgba(26, 107, 60, 0.15);
    border-color: rgba(26, 107, 60, 0.35);
}

.news-item:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.news-item:hover .aws-arrow {
    transform: translateX(5px);
}

/* ============================================================
   AWS Cloud Enterprise Card Design System (aws.amazon.com)
   ============================================================ */

/* Base AWS Card Container */
.aws-card {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease,
                background-color 0.2s ease;
    will-change: transform, box-shadow;
}

/* AWS Signature Top Accent Line */
.aws-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a6b3c 0%, #2d8f54 50%, #d4af37 100%);
    opacity: 0;
    transform: scaleX(0.7);
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s ease;
    z-index: 10;
}

/* AWS Hover Physics Lift & Glow */
.aws-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -4px rgba(13, 74, 40, 0.08), 
                0 6px 12px -2px rgba(0, 0, 0, 0.04), 
                0 0 0 1px rgba(26, 107, 60, 0.12);
    border-color: rgba(26, 107, 60, 0.35);
}

.aws-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
    height: 3.5px;
}

/* Variant: Gold / Accent Card (Tahfidz, Prestasi, Gelombang I) */
.aws-card-gold::before,
.aws-card-accent::before {
    background: linear-gradient(90deg, #d4af37 0%, #f59e0b 50%, #d4af37 100%);
}
.aws-card-gold:hover,
.aws-card-accent:hover {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 16px 32px -4px rgba(212, 175, 55, 0.15), 
                0 6px 12px -2px rgba(0, 0, 0, 0.04), 
                0 0 0 1px rgba(212, 175, 55, 0.25);
}

/* Variant: Tech Blue Card (Coding, Sains, Robotika) */
.aws-card-blue::before {
    background: linear-gradient(90deg, #2563eb 0%, #38bdf8 50%, #2563eb 100%);
}
.aws-card-blue:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 16px 32px -4px rgba(37, 99, 235, 0.12), 
                0 6px 12px -2px rgba(0, 0, 0, 0.04), 
                0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* AWS Service / Feature Tile (Quick Access, Glosarium, Ekstrakurikuler, Ekosistem) */
.aws-tile {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease,
                background-color 0.2s ease;
    overflow: hidden;
}

.aws-tile::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: #1a6b3c;
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.aws-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
    border-color: rgba(26, 107, 60, 0.35);
    background-color: #fafdfa;
}

.aws-tile:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.aws-tile .aws-tile-icon {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
}

.aws-tile:hover .aws-tile-icon {
    transform: scale(1.12);
}

/* AWS Signature Action Arrow Micro-Interaction */
.aws-arrow {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s ease;
    will-change: transform;
}

.aws-card:hover .aws-arrow,
.group:hover .aws-arrow,
a:hover .aws-arrow,
button:hover .aws-arrow,
.news-item:hover .aws-arrow {
    transform: translateX(5px);
}

/* AWS Media Card Image Zoom */
.aws-card-img {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.aws-card:hover .aws-card-img,
.group:hover .aws-card-img {
    transform: scale(1.05);
}

/* Custom Tooltip for News Cards */
.news-item[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: #1a6b3c;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.news-item:hover[data-tooltip]::before {
    opacity: 1;
}

#map {
    height: 400px;
    width: 100%;
}

/* Accessibility Focus States (WAI-ARIA WCAG 2.1) */
:focus-visible {
    outline: 2px solid #d4af37 !important;
    outline-offset: 2px !important;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #d4af37 !important;
    outline-offset: 2px !important;
}

/* Tablet & Mobile Grid Breakpoints Enforcement */
@media (min-width: 768px) {
    .news-grid-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* UI/UX Pro Max & Frontend Design High-Craft Utilities */
.cursor-pointer {
    cursor: pointer;
}

.card-hover-glow {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}
.card-hover-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(6, 56, 29, 0.12), 0 8px 10px -6px rgba(6, 56, 29, 0.08);
}

/* Glass Card Refined */
.glass-card-dark {
    background: rgba(11, 61, 33, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

/* Ripple Badge Animation */
.badge-glow {
    position: relative;
}
.badge-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #10b981, #d4af37);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.4;
    filter: blur(4px);
    transition: opacity 0.3s ease;
}
.badge-glow:hover::before {
    opacity: 0.8;
}



