/* ============================================
   IMPORTS
   ============================================ */

/* Tailwind CSS */
@import url('../dist/output.css');

/* Font Awesome */
@import url('../fonts/font-awesome/css/all.min.css');

/* ============================================
   FONT FACE - Fira Sans (Woff Format)
   ============================================ */

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-Italic.woff2') format('woff2'),
        url('subset-FiraSans-Italic.woff') format('woff');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-Bold.woff2') format('woff2'),
        url('subset-FiraSans-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-Medium.woff2') format('woff2'),
        url('subset-FiraSans-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-MediumItalic.woff2') format('woff2'),
        url('subset-FiraSans-MediumItalic.woff') format('woff');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-Regular.woff2') format('woff2'),
        url('subset-FiraSans-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Sans';
    src: url('subset-FiraSans-SemiBold.woff2') format('woff2'),
        url('subset-FiraSans-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}


/* ============================================
   GLOBAL STYLES
   ============================================ */

/* Auto UPPERCASE untuk input nama */
.auto-uppercase {
    text-transform: uppercase;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
}

/* ============================================
   HERO GRADIENT
   ============================================ */

.hero-gradient {
    background: linear-gradient(135deg, #2629cd 0%, #0f2aa6 50%, #0c31a9 100%)
}


.blue-gradient-text {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   CARD HOVER EFFECT
   ============================================ */

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   FLOAT ANIMATION
   ============================================ */

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   MOBILE MENU
   ============================================ */

#mobile-menu-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#mobile-menu {
    transition: all 0.3s ease;
}

/* ============================================
   FONT AWESOME ICON STYLING
   ============================================ */

.icon-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle-lg {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .hero-gradient h1 {
        font-size: 2rem;
    }
}

/* ============================================
   SMOOTH SCROLL & MOBILE OPTIMIZATION
   ============================================ */

/* Smooth scroll untuk semua halaman */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
}

/* Body scroll normal - INI YANG SCROLL */
body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Safe area untuk notch/home indicator */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ============================================
   LOGIN/REGISTER PAGE LAYOUT - TIDAK SCROLL
   ============================================ */

.login-page,
.register-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    position: relative;
    /* PENTING: TIDAK overflow, biarkan body yang scroll */
    overflow: visible;
}

/* Container di dalam login page */
.login-page > .relative,
.register-page > .relative {
    width: 100%;
    max-width: 28rem;
    flex-shrink: 0;
}

/* Floating shapes */
.floating-shape {
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
    position: absolute;
}

/* Input focus auto scroll */
input:focus,
select:focus,
textarea:focus {
    scroll-margin-top: 100px;
    scroll-margin-bottom: 100px;
}

/* Card login/register */
.login-card,
.register-card {
    width: 100%;
}

/* ============================================
   RESPONSIVE - Mobile dengan keyboard
   ============================================ */

@media (max-height: 700px) {
    .login-page,
    .register-page {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .login-page > .relative,
    .register-page > .relative {
        margin: 1rem auto;
    }
    
    .school-badge,
    .admin-badge {
        width: 4rem !important;
        height: 4rem !important;
        margin-bottom: 1rem !important;
    }
    
    .school-badge i,
    .admin-badge i {
        font-size: 1.5rem !important;
    }
    
    .login-card,
    .register-card {
        padding: 1.25rem !important;
    }
}

/* ============================================
   SCROLLBAR STYLING - HANYA 1 SCROLLBAR
   ============================================ */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(0, 0, 0, 0.05);
}

/* Chrome, Edge, Safari - Scrollbar browser */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
    background-clip: content-box;
    border: 2px solid transparent;
}

/* Prevent zoom on input focus di iOS */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Force show mobile menu button */
#mobile-menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999999 !important;
}

@media (min-width: 768px) {
    #mobile-menu-btn {
        display: none !important;
    }
}

/* ============================================
   SIDEBAR PARENT-CHILD MENU
   ============================================ */

/* Submenu animation */
.submenu {
    transition: all 0.3s ease;
    overflow: hidden;
}

.submenu.block {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

.submenu.hidden {
    display: none !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Chevron rotation */
.parent-menu-btn .fa-chevron-down {
    transition: transform 0.3s ease;
}

.parent-menu-btn[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Hover effect untuk parent button */
.parent-menu-btn {
    cursor: pointer;
    user-select: none;
}

.parent-menu-btn:hover {
    background-color: rgba(29, 78, 216, 0.5);
}

/* Active child indicator */
.submenu a.bg-blue-600 {
    position: relative;
}

.submenu a.bg-blue-600::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #60a5fa;
    border-radius: 2px;
}

/* Sidebar overlay untuk mobile */
#sidebar-overlay {
    display: none;
}

@media (max-width: 767px) {
    #sidebar-overlay.show {
        display: block;
    }
}

/* ============================================
   SIDEBAR OVERLAY - MOBILE
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-overlay.hidden {
    display: none !important;
    opacity: 0;
}

/* ============================================
SIDEBAR TRANSITION
============================================ */
#sidebar {
    transition: transform 0.3s ease-in-out;
}

/* Overlay styling */
#sidebar-overlay {
    transition: opacity 0.3s ease;
}

#sidebar-overlay.hidden {
    display: none !important;
}

/* ============================================
SIDEBAR OVERLAY - MOBILE
============================================ */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.show {
    display: block;
    opacity: 1;
}

#sidebar-overlay.hidden {
    display: none !important;
    opacity: 0;
}

@media (min-width: 768px) {
    #sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
SIDEBAR FIX - MOBILE (tidak tertutup topbar)
============================================ */
@media (max-width: 767px) {
    #sidebar {
        /* Sidebar dimulai dari atas, tapi konten di dalamnya ada padding-top */
        top: 0;
        height: 100vh;
        height: 100dvh;
    }
    
    /* Header sidebar di mobile: tambah padding-top agar tidak tertutup topbar */
    #sidebar > div > div:first-child {
        padding-top: 5rem !important;
    }
}

@media (min-width: 768px) {
    #sidebar {
        top: 0;
    }
    
    #sidebar > div > div:first-child {
        padding-top: 1rem !important;
    }
}

/* ============================================
CLOSE BUTTON - HANYA MOBILE
============================================ */
#close-sidebar {
    display: block;
}

@media (min-width: 768px) {
    #close-sidebar {
        display: none !important;
    }
}

/* Tambahkan di css/custom.css */
.password-display {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    background: #fef3c7;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px dashed #f59e0b;
    display: inline-block;
    color: #92400e;
}
.copy-btn {
    transition: all 0.2s;
}
.copy-btn.copied {
    background-color: #10b981 !important;
    color: white !important;
}