/* Root Variables (Premium Design System) */
:root {
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary: #ec4899;
    --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    --accent: #10b981;
    --dark: #0f172a;
    --light: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

[data-theme="dark"] {
    --primary: #818cf8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --secondary: #f472b6;
    --dark: #f8fafc;
    --light: #0d1117;
    --glass-bg: rgba(13, 17, 23, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --card-bg: rgba(22, 27, 34, 0.85);
    --text-muted: #8b949e;
}

[data-theme="dark"] .text-dark {
    color: var(--dark) !important;
}

[data-theme="dark"] .form-label {
    color: var(--primary) !important;
}

[data-theme="dark"] input.form-control {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] input.form-control::placeholder {
    color: #94a3b8 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Remove default focus outline but keep focus-visible for keyboard users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: var(--font-body);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main,
section.section {
    flex: 1 0 auto;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Background animated blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: moveObj 20s infinite alternate;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    opacity: 0.3;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    opacity: 0.2;
    animation-direction: alternate-reverse;
}

@keyframes moveObj {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(100px, 50px) scale(1.1);
    }

    100% {
        transform: translate(-50px, 150px) scale(0.9);
    }
}

/* Glassmorphism Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    transition: all 0.3s ease;
}

.navbar .logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.navbar nav {
    display: flex;
}

.navbar nav a {
    text-decoration: none;
    color: var(--dark);
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar nav a:hover {
    color: var(--primary);
}

.navbar nav a.active {
    color: var(--primary) !important;
    position: relative;
}

.navbar nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 20px;
    transition: transform 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-border);
}

.theme-toggle:hover {
    transform: rotate(30deg);
    background: rgba(124, 58, 237, 0.1);
}

.navbar.scrolled {
    padding: 12px 5%;
    box-shadow: var(--shadow);
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

.btn-admin {
    background: var(--secondary-gradient) !important;
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
    opacity: 0.9;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 5% 50px;
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

h1.glitch-text {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
    transition: var(--transition);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Sections & Cards */
.section {
    padding: 80px 5%;
}

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

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--dark);
}


.card {
    background: var(--card-bg);
    color: var(--dark) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--glass-border) 25%, var(--glass-bg) 50%, var(--glass-border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
    width: 100%;
}

.skeleton-title {
    height: 30px;
    width: 70%;
    margin: 0 auto 20px;
}

.skeleton-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 15px 50px 15px 25px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    color: var(--dark);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-container i {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    flex: 1;
}

.card-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.card:hover .card-btn {
    background: var(--primary);
    color: white;
}

/* Modal Popup */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    width: 95%;
    max-width: 850px;
    background: #ffffff !important;
    border-radius: 28px;
    padding: 0;
    z-index: 1050;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .modal {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.modal.show,
.overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal.show {
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 30px;
    background: var(--primary-gradient);
    color: white;
    position: relative;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: white !important;
    letter-spacing: -0.5px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--modal-border);
    padding-bottom: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 12px 20px;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
    color: #0f172a !important;
    line-height: 1.8;
}

[data-theme="dark"] .tab-content {
    color: #f8fafc !important;
}

.tab-content.active {
    display: block;
}

/* Typography and Layout within Modal Content */
.tab-content h1,
.tab-content h2,
.tab-content h3 {
    color: var(--primary);
    margin-top: 25px;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.tab-content h1 {
    font-size: 1.6rem;
}

.tab-content h2 {
    font-size: 1.4rem;
}

.tab-content h3 {
    font-size: 1.2rem;
}

.tab-content ul,
.tab-content ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.tab-content li {
    margin-bottom: 8px;
}

.tab-content p {
    margin-bottom: 15px;
}

/* Table Styles Refinement - CLEAN SWEEP */
.tab-content table {
    width: 100%;
    border-collapse: collapse !important;
    margin: 25px 0 !important;
    font-size: 0.95em !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
}

.tab-content table thead tr:first-child,
.tab-content table thead tr:first-child th {
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
}

.tab-content table thead tr:not(:first-child),
.tab-content table thead tr:not(:first-child) th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.tab-content table th,
.tab-content table td {
    padding: 12px 15px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
    vertical-align: middle !important;
    background-color: transparent;
}

/* Ensure no transparent text in body */
.tab-content table tbody tr td,
.tab-content table tbody tr th {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.tab-content table tbody tr:nth-of-type(even) td,
.tab-content table tbody tr:nth-of-type(even) th {
    background-color: #f8fafc !important;
}

.tab-content table tfoot,
.tab-content table tfoot tr td {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    font-weight: bold;
}

/* Dark Mode Absolute Overrides */
[data-theme="dark"] .tab-content table {
    background-color: #000000 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    --bs-table-bg: #000000 !important;
    --bs-table-color: #ffffff !important;
}

[data-theme="dark"] .tab-content table thead tr:not(:first-child),
[data-theme="dark"] .tab-content table thead tr:not(:first-child) th,
[data-theme="dark"] .tab-content .table-light,
[data-theme="dark"] .tab-content .table-light th,
[data-theme="dark"] .tab-content .table-light td {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

[data-theme="dark"] .tab-content table tbody tr td,
[data-theme="dark"] .tab-content table tbody tr th,
[data-theme="dark"] .tab-content table th,
[data-theme="dark"] .tab-content table td {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .tab-content table tbody tr:nth-of-type(even) td,
[data-theme="dark"] .tab-content table tbody tr:nth-of-type(even) th {
    background-color: #0d1117 !important;
}

[data-theme="dark"] .tab-content .text-success {
    color: #4ade80 !important;
}

[data-theme="dark"] .tab-content .text-danger {
    color: #f87171 !important;
}

[data-theme="dark"] .tab-content table tfoot,
[data-theme="dark"] .tab-content table tfoot tr td {
    background-color: #111827 !important;
    color: #ffffff !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 30px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-muted);
    margin-top: auto;
}

/* Imsakiyah Table Styling */
.table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 1000px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.imsakiyah-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.95rem;
}

/* Enhanced Rundown Table Borders */
#rundown-container table,
.note-editable table,
.rundown-display table {
    border: 2px solid var(--primary) !important;
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
    background: var(--glass-bg);
}

#rundown-container table th,
#rundown-container table td,
.note-editable table th,
.note-editable table td,
.rundown-display table th,
.rundown-display table td {
    border: 1.5px solid rgba(0, 0, 0, 0.15) !important;
    padding: 12px 15px !important;
}

[data-theme="dark"] #rundown-container table th,
[data-theme="dark"] #rundown-container table td,
[data-theme="dark"] .note-editable table th,
[data-theme="dark"] .note-editable table td,
[data-theme="dark"] .rundown-display table th,
[data-theme="dark"] .rundown-display table td {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

#rundown-container table thead th,
.note-editable table thead th,
.rundown-display table thead th {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.imsakiyah-table th,
.imsakiyah-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.imsakiyah-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.imsakiyah-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.imsakiyah-table tbody tr:last-child td {
    border-bottom: none;
}

.imsakiyah-table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.imsakiyah-table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.imsakiyah-table .sub-th {
    background: #4338CA;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }

    h1.glitch-text {
        font-size: 2.5rem;
    }

    /* In a real app, add a hamburger menu */

    .imsakiyah-table {
        font-size: 0.75rem;
    }

    .imsakiyah-table th,
    .imsakiyah-table td {
        padding: 8px 3px;
    }

    .table-container {
        padding: 10px;
        border-radius: 12px;
    }

    /* Modal Mobile Adjustments */
    .modal {
        width: 100%;
        max-height: 95vh;
        border-radius: 15px;
        transform: translate(-50%, -40%) scale(0.98);
        /* Less scale down on mobile */
    }

    .modal-header {
        padding: 20px 20px;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }

    .modal-header h3 {
        font-size: 1.3rem;
        line-height: 1.4;
        padding-right: 35px;
        /* Prevent text overlapping close button */
    }

    .close-btn {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }

    .tab-content {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .tab-content h1,
    .tab-content h2,
    .tab-content h3 {
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .tab-content h1 {
        font-size: 1.3rem;
    }

    .tab-content h2 {
        font-size: 1.15rem;
    }

    .tab-content h3 {
        font-size: 1.05rem;
    }

    .tab-content ul,
    .tab-content ol {
        margin-left: 20px;
    }
}

/* Modul Page Specific Styles */
.modul-layout {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modul-sidebar {
    width: 250px;
    background: transparent;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
}

.modul-tab {
    padding: 12px 20px;
    text-align: left;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modul-tab:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    transform: translateX(5px);
}

.modul-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

@media (max-width: 768px) {
    .modul-layout {
        flex-direction: column;
    }

    .modul-sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        overflow-x: auto;
        padding: 15px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .modul-tab {
        flex: 0 0 auto;
    }
}

.modul-content {
    flex: 1;
    padding: 40px;
}

.modul-content h2 {
    font-family: var(--font-heading);
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 2px dashed rgba(14, 165, 233, 0.3);
    padding-bottom: 10px;
}

.modul-content h3 {
    color: var(--dark);
    margin-top: 25px;
    margin-bottom: 15px;
}

.modul-content p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

.modul-list {
    list-style: none;
    padding: 0;
}

.modul-list li {
    padding: 10px 15px;
    background: var(--modul-list-bg, rgba(255, 255, 255, 0.5));
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--dark);
    display: flex;
    align-items: center;
    border-left: 3px solid var(--primary);
}

.modul-list.strict-list li {
    border-left: 3px solid #ef4444;
    /* Red border */
}

#pwa-install {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    font-family: var(--font-body);
    transition: all 0.3s;
}

#pwa-install:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.modul-list li span {
    font-weight: bold;
    color: var(--primary);
    margin-right: 15px;
    font-size: 1.1rem;
}

.card-grid {
    display: grid;
    gap: 15px;
}

.mini-card {
    background: var(--modul-mini-card-bg, rgba(255, 255, 255, 0.6));
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
    color: var(--dark);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

.mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    background: var(--modul-mini-card-hover, white);
}

.modul-highlight {
    background: rgba(14, 165, 233, 0.1);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    color: var(--dark);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .modul-layout {
        flex-direction: column;
        overflow: visible;
        /* Allow content to flow naturally or scroll internally */
    }

    .modul-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--primary);
    }

    .modul-tab {
        text-align: center;
        padding: 15px;
    }

    .modul-content {
        padding: 20px;
        overflow-x: auto;
        /* Enable horizontal scroll for tables */
        -webkit-overflow-scrolling: touch;
    }

    .card-grid {
        grid-template-columns: 1fr !important;
        /* Force single column on mobile */
        gap: 10px;
    }
}

/* --- Added Enhancement Styles --- */

/* 1. Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 101;
    padding: 10px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: rgba(79, 70, 229, 0.2);
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.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, -7px);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .navbar nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--light);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 100;
        backdrop-filter: blur(10px);
    }

    .navbar nav.active {
        right: 0;
    }

    .navbar nav a {
        margin: 0;
        font-size: 1.2rem;
    }
}

/* 2. Countdown Timer */
.countdown-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.countdown-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 12px;
    min-width: 80px;
    text-align: center;
    box-shadow: var(--shadow);
}

.countdown-box .number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
}

.countdown-box .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* 3. Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 2rem;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-circle {
    height: 4rem;
    width: 4rem;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

/* 4. Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    z-index: 1001;
    transition: width 0.1s;
}

/* 5. Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-hover);
}

/* 6. Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(79, 70, 229, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.preloader-logo {
    height: 60px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Announcement Box */
.announcement-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.announcement-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.announcement-icon {
    width: 70px;
    height: 70px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.announcement-info h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.announcement-info div {
    color: var(--dark);
    line-height: 1.7;
    font-size: 1.05rem;
}

.announcement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.announcement-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 18px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.announcement-list li:hover {
    background: rgba(79, 70, 229, 0.1);
    transform: translateX(5px);
}

.announcement-list li i {
    margin-top: 4px;
    font-size: 1rem;
    color: var(--primary);
}

.announcement-list li span {
    font-weight: 400;
}

@media (max-width: 768px) {
    .announcement-card {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .announcement-icon {
        margin: 0 auto 15px;
    }

    .announcement-info h3 {
        font-size: 1.2rem;
    }

    .announcement-list li {
        text-align: left;
    }
}

/* ====== PREMIUM AGENDA MODAL ====== */
.modal-premium {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.9);
    width: 90%;
    max-width: 500px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    z-index: 2000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.modal-premium.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    display: flex;
}

.modal-premium-header {
    padding: 24px 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-premium-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: white !important;
}

.modal-premium-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-premium-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.modal-premium-body {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.premium-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.premium-list li {
    padding: 12px 15px;
    background: rgba(79, 70, 229, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
    animation: slideInRight 0.5s ease backwards;
}

.premium-list li:nth-child(even) {
    border-left-color: var(--secondary);
    background: rgba(236, 72, 153, 0.05);
}

.premium-list li:hover {
    transform: translateX(5px);
}

.modal-premium-footer {
    padding: 15px 30px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 10s linear;
}

.loader-small {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Nav Link Overlay for Mobile */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* --- Responsive Media Queries --- */

@media (max-width: 1024px) {
    h1.glitch-text {
        font-size: 3.2rem;
    }
}

@media (max-width: 768px) {
    h1.glitch-text {
        font-size: 2.5rem !important;
    }

    .hero {
        flex-direction: column !important;
        text-align: center !important;
        padding-top: 120px !important;
        gap: 20px !important;
    }

    .hero-content {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-image {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 350px !important;
        margin-top: 20px !important;
    }

    .hero-content div {
        justify-content: center !important;
    }

    /* Modul Page Mobile Fixes */
    .modul-container {
        flex-direction: column;
    }

    .modul-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 2px solid var(--glass-border);
        flex-direction: row !important;
        overflow-x: auto;
        padding: 10px !important;
        gap: 10px !important;
    }

    .modul-tab {
        white-space: nowrap;
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
    }

    .modul-content {
        padding: 20px !important;
    }

    .navbar nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 350px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.85);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 15px;
        /* Reduced from 25px */
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.1);
        z-index: 10000;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: 1px solid rgba(255, 255, 255, 0.5);
    }

    [data-theme="dark"] .navbar nav {
        background: rgba(15, 23, 42, 0.85);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar nav a {
        font-size: 1.05rem;
        /* Reduced from 1.2rem */
        font-weight: 600;
        margin: 0;
        padding: 8px 15px;
        /* Reduced padding */
        border-radius: 12px;
        width: 75%;
        /* Tighter width */
        text-align: center;
        transition: all 0.3s ease;
    }

    .navbar nav a:hover {
        background: rgba(79, 70, 229, 0.1);
        transform: translateY(-2px);
    }

    .navbar nav a.active::after {
        display: none;
    }

    .navbar nav a.active {
        background: var(--primary) !important;
        color: white !important;
        box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    }

    /* Ensure btn-admin stays pink even if active on mobile */
    .navbar nav a.btn-admin {
        background: var(--secondary-gradient) !important;
        margin-top: 10px;
        padding: 10px 24px;
        box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    }

    .navbar nav.active {
        right: 0;
    }
}

@media (max-width: 768px) {

    /* Stack action buttons cleanly on smaller screens */
    .div-buttons {
        flex-direction: column !important;
        width: 100%;
    }

    .div-buttons a {
        width: 100% !important;
        text-align: center;
        margin-bottom: 5px;
    }

    /* Force hero content to span full width */
    .hero-content {
        flex: 0 0 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .hero-image {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    .hero .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ensure countdown blocks wrap neatly into a 2x2 grid */
    .countdown-container {
        flex-wrap: wrap !important;
    }

    .countdown-box {
        flex: 1 1 40% !important;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    h1.glitch-text {
        font-size: 2rem !important;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
        padding: 12px 24px !important;
    }

    .hero p {
        font-size: 1rem !important;
    }

    .hero-image img {
        max-height: 250px !important;
    }
}

[data-theme="dark"] .modal-premium {
    background: rgba(15, 23, 42, 0.85);
}

[data-theme="dark"] .progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-premium-footer {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Dark Mode Modal & Table Fixes --- */
[data-theme="dark"] .modal {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-header h3 {
    color: white !important;
}

[data-theme="dark"] .modal-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .tab-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--primary) !important;
    background: rgba(129, 140, 248, 0.1) !important;
}

[data-theme="dark"] .tab-btn.active {
    color: var(--primary) !important;
    background: rgba(129, 140, 248, 0.2) !important;
}

[data-theme="dark"] .modal-body {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-body table {
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .modal-body th {
    background: rgba(129, 140, 248, 0.3) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .modal-body td {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-body tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .modal-body tr:hover {
    background: rgba(129, 140, 248, 0.1) !important;
}

/* Fix for nested elements or direct text */
[data-theme="dark"] .modal-body p,
[data-theme="dark"] .modal-body li,
[data-theme="dark"] .modal-body span,
[data-theme="dark"] .modal-body strong {
    color: #e2e8f0 !important;
}

/* Fix for nested elements or direct text in modals and tab content */
[data-theme="dark"] .modal-body p,
[data-theme="dark"] .modal-body li,
[data-theme="dark"] .modal-body span,
[data-theme="dark"] .modal-body strong,
[data-theme="dark"] .tab-content p,
[data-theme="dark"] .tab-content li,
[data-theme="dark"] .tab-content span,
[data-theme="dark"] .tab-content div {
    color: #e2e8f0 !important;
}

/* Specific fix for Imsakiyah and other tables outside modals */
[data-theme="dark"] .imsakiyah-table,
[data-theme="dark"] .tab-content table {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .imsakiyah-table th,
[data-theme="dark"] .tab-content table th {
    background: rgba(129, 140, 248, 0.3) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .imsakiyah-table td,
[data-theme="dark"] .tab-content table td {
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .imsakiyah-table tbody tr:nth-child(even),
[data-theme="dark"] .tab-content table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .imsakiyah-table tbody tr:hover,
[data-theme="dark"] .tab-content table tbody tr:hover {
    background-color: rgba(129, 140, 248, 0.1) !important;
}

/* Ensure Summernote and other editors in dark mode are readable if applicable */
[data-theme="dark"] .note-editor {
    background: #1e293b !important;
    color: white !important;
}

/* --- Global Bootstrap Overrides for Dark Mode --- */
[data-theme="dark"] .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--dark) !important;
}

[data-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--dark) !important;
}

[data-theme="dark"] .text-primary {
    color: var(--primary) !important;
}

[data-theme="dark"] .bg-primary {
    background-color: var(--primary) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--dark) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] .form-select {
    background-color: var(--light) !important;
    color: var(--dark) !important;
    border-color: var(--glass-border) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

/* Ensure all heading titles override any nested Bootstrap color utilities */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--dark);
}

/* ====== SPESIFIK HALAMAN MODUL DAN LOMBA ====== */
.page-header {
    padding-top: 150px;
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--primary);
}

.modul-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.modul-container p {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.download-btn {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(16, 185, 129, 0.4);
}

/* Dark mode specific for imsakiyah table in modul */
.imsakiyah-table tbody tr:nth-child(even) {
    background: var(--modul-table-row-even, #f8fafc);
}

.imsakiyah-table tbody tr:hover {
    background: var(--modul-table-row-hover, rgba(79, 70, 229, 0.05));
}

/* Fix table border color in dark mode */
[data-theme="dark"] .imsakiyah-table th,
[data-theme="dark"] .imsakiyah-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Fix modul-highlight dark mode */
[data-theme="dark"] .modul-highlight {
    background: rgba(99, 102, 241, 0.15);
    border-left-color: var(--primary);
}

/* Fix sanksi highlight */
[data-theme="dark"] .modul-highlight[style*="ef4444"] {
    background: rgba(239, 68, 68, 0.12) !important;
}

/* Smooth theme transition */
body,
.modul-layout,
.modul-sidebar,
.modul-content,
.modul-list li,
.mini-card,
.imsakiyah-table tbody tr {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Responsive Overrides untuk Halaman Modul & Lomba */
@media (max-width: 1024px) {
    .page-header {
        padding-top: 240px;
        margin-top: 20px;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .page-header p {
        font-size: 1.05rem;
    }
}

/* Premium UI Utilities */
.glass-card-premium {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    overflow: hidden;
}

[data-theme="dark"] .glass-card-premium {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.glass-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15) !important;
}

.stat-gradient-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    position: relative;
    z-index: 1;
}

.stat-gradient-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
    z-index: -1;
}

.pulse-status {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.hover-lift {
    transition: transform 0.2s ease !important;
}

.hover-lift:hover {
    transform: translateY(-3px) !important;
}

.premium-table thead th {
    background: var(--surface) !important;
    border: none !important;
    font-weight: 700 !important;
    letter-spacing: 0.05rem !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    padding: 15px !important;
}

.premium-table tbody tr {
    transition: background 0.2s ease !important;
}

.premium-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.04) !important;
}

[data-theme="dark"] .premium-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 1rem !important;
    }

    .page-header {
        padding-top: 140px;
        margin-bottom: 20px;
    }

    .modul-container {
        padding: 20px;
    }

    /* Lomba Mobile Optimization */
    .input-group-lg>.form-control,
    .input-group-lg>.input-group-text {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    #lomba-container .card {
        padding: 0.8rem !important;
    }

    #lomba-container .card-icon {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
    }

    #lomba-container h3 {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
    }

    #lomba-container p {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }

    #lomba-container .btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    /* Announcement Box Mobile Optimization */
    .announcement-card {
        padding: 1rem !important;
    }

    .announcement-icon {
        font-size: 1.5rem !important;
    }

    .announcement-card h4 {
        font-size: 1.1rem !important;
    }

    #announcement-text,
    #announcement-text p,
    #announcement-text li span {
        font-size: 0.85rem !important;
    }

    /* Modal Mobile Optimization */
    .modal-content {
        padding: 20px;
    }

    #modalTitle {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .tab-content,
    .tab-content p,
    .tab-content li {
        font-size: 0.85rem !important;
    }

    .tab-content {
        padding: 15px 0;
    }

    .tab-content table th,
    .tab-content table td {
        padding: 8px 5px !important;
        font-size: 0.8rem !important;
    }

    /* Login Mobile Optimization */
    .login-card {
        padding: 1.5rem 1.2rem !important;
    }

    .login-header img {
        height: 60px !important;
    }

    .login-card h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .login-card .form-control-lg {
        padding: 0.5rem 1rem 0.5rem 40px !important;
        font-size: 0.95rem;
    }

    .login-card .fa-user,
    .login-card .fa-lock {
        font-size: 0.9rem;
        left: 15px !important;
    }

    .login-card .btn-lg {
        padding: 10px 20px !important;
        font-size: 0.95rem !important;
    }

    .login-card a {
        font-size: 0.8rem !important;
    }
}