/* ==========================================================================
   TETAPAN ASAS & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   STYLES NAVIGASI (DESKTOP)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(24, 39, 57, 0.98);
    backdrop-filter: blur(8px);
    padding: 15px 20px;
    color: #fff;
    box-shadow: 0 2px 10px rgba(209, 202, 202, 0.2);
    z-index: 1000; /* Lapisan teratas supaya tidak bertindih */
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eff4f8;
    white-space: nowrap;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo i {
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
    list-style: none;
}

.nav-btn {
    text-decoration: none;
    color: #fefefe;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.nav-btn:hover, .nav-btn.active {
    background-color: #153252;
    color: #ffffff;
}

.nav-links .btn-primary {
    background-color: #3498db !important;
    color: #ffffff !important;
    font-weight: bold;
}

.nav-links .btn-primary:hover {
    background-color: #2980b9 !important;
}

.btn-apply {
    background-color: #27ae60 !important;
    color: #fff !important;
    font-weight: bold;
}

.btn-apply:hover {
    background-color: #219150 !important;
}

.btn-nav-home {
    background: #5e71ce !important;
    color: #ffffff !important;
}

.btn-logout {
    background: #dc3545 !important;
    color: #ffffff !important;
}

/* Sembunyikan ikon 3 garis pada skrin desktop secara lalai */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001; /* Memastikan butang boleh ditekan di mobile */
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: url('https://themalaysianreserve.com/wp-content/uploads/2025/10/MOSTI.jpg') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 60px 20px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(20, 30, 48, 0.85), rgba(36, 59, 85, 0.85));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Badge tajuk yang kemas & responsive */
.hero-badge {
    display: inline-block;
    max-width: 90%;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.6);
    color: #fefbff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    line-height: 1.25;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.15rem;
    color: #e0e6ed;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.3s;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

/* ==========================================================================
   KONTEN UTAMA & CONTAINER
   ========================================================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    margin-top: 100px;
    padding-bottom: 60px;
}

.content-section {
    padding: 80px 0;
}

.bg-light {
    background-color: #f5ebeb;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-title p {
    color: #7f8c8d;
    font-size: 1.05rem;
}

/* Layout Keterangan Syarikat */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text h3 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.about-text p {
    color: #555;
    margin-bottom: 15px;
}

.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-box h4 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.stat-box p {
    font-size: 0.75rem;
    color: #777;
    margin: 0;
}

.icon {
    font-size: 1.4rem;
    padding: 10px;
    border-radius: 6px;
}

.icon.blue { background: #ebf5fb; color: #3498db; }
.icon.green { background: #e8f8f5; color: #2ecc71; }
.icon.orange { background: #fef5e7; color: #e67e22; }

/* Kad Visi Misi */
.about-card-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 5px solid #3498db;
}

.card-info.highlight {
    border-left-color: #2ecc71;
}

.card-icon {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 10px;
}

.card-info.highlight .card-icon {
    color: #2ecc71;
}

/* Grid Perkhidmatan */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.service-card {
    text-align: center;
}

.service-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 15px;
}

.service-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Calendar Container */
.calendar-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.fc .fc-toolbar-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1e293b;
}

.fc .fc-button-primary {
    background-color: #2d3748 !important;
    border-color: #2d3748 !important;
    color: #ffffff !important;
    text-transform: lowercase;
    font-size: 0.9rem;
    padding: 6px 12px;
}

.fc .fc-button-primary:hover {
    background-color: #1a202c !important;
}

.fc .fc-col-header-cell-cushion {
    color: #112e5b !important;
    text-decoration: underline !important;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px 0;
}

.fc .fc-daygrid-day-number {
    color: #0066ff !important;
    text-decoration: underline !important;
    font-size: 0.9rem;
    padding: 8px;
}

.fc .fc-day-other .fc-daygrid-day-number {
    color: #a0aec0 !important;
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: #edf2f7 !important;
}

.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events {
    min-height: 2em;
}

.fc-event {
    cursor: pointer;
    border: none !important;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Form Styles */
.contact-box {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Buttons */
.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-primary-sm {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    margin-top: 15px;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: white;
    color: #2c3e50;
}

.full-width {
    width: 100%;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   PAGE LOGIN & REGISTER
   ========================================================================== */
.auth-wrapper {
    min-height: calc(100vh - 180px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 80px;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 35px 30px;
    border: 1px solid #e2e8f0;
}

.permohonan-card {
    max-width: 900px !important;
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: #157076;
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: #ffffff;
    color: #3498db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.input-icon-wrapper input,
.input-icon-wrapper select {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.input-icon-wrapper input[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.input-icon-wrapper input:focus,
.input-icon-wrapper select:focus {
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: pointer;
}

.forgot-pass {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.forgot-pass:hover {
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    background: #27ae60;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-auth:hover {
    background: #219150;
}

.btn-auth:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Grid Borang Permohonan */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 20px;
}

.form-group.full-width {
    grid-column: span 2;
}

/* ==========================================================================
   PENYESUAIAN LAYOUT RESPONSIF (MOBILE WITH HAMBURGER MENU)
   ========================================================================== */

/* --- Laptop / Desktop Kecil (hingga 1200px) --- */
@media screen and (max-width: 1200px) {
    .navbar {
        padding: 12px 20px;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .container, .main-container {
        padding: 0 20px;
    }

    .permohonan-card {
        max-width: 100% !important;
    }
}

/* --- Mobile & Tablet (768px dan ke bawah) --- */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
    }

    /* Paparkan Butang 3 Garis */
    .menu-toggle {
        display: flex !important;
    }

    /* Sembunyikan Menu Navigasi secara lalai */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(44, 62, 80, 0.98);
        padding: 15px 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        gap: 10px;
    }

    /* Paparkan menu apabila class .active ditambah melalui JS */
    .nav-links.active {
        display: flex !important;
    }

    .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    /* Animasi pertukaran ikon 3 garis ke tanda 'X' apabila dibuka */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* Pelarasan Hero Section pada Mobile */
    .hero {
        padding: 110px 15px 50px 15px;
        min-height: 100vh;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
        margin-bottom: 15px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: 12px;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-buttons a {
        width: 100%;
        text-align: center;
    }

    .scroll-down-indicator {
        display: none; /* Sembunyikan petunjuk scroll di mobile supaya tak penuh skrin */
    }

    .about-grid,
    .stats-mini-grid,
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .calendar-card {
        padding: 15px;
        overflow-x: auto;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .contact-box {
        padding: 20px;
    }

    /* Layout Borang Permohonan Mobile */
    .auth-wrapper {
        padding: 90px 15px 30px 15px;
    }

    .auth-card {
        padding: 20px 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .auth-header h2 {
        font-size: 1.4rem;
    }

    .auth-header p {
        font-size: 0.85rem;
    }
}