/* Munaqosyah-v2 Custom Styles */

/* Smooth page transitions */
body {
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar scrollbar */
#sidebar::-webkit-scrollbar-thumb {
    background: #475569;
}

/* DataTable overrides */
.dataTable-wrapper .dataTable-top,
.dataTable-wrapper .dataTable-bottom {
    padding: 8px 0;
}

.dataTable-wrapper .dataTable-search input {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* --- Global Responsive Fixes --- */
body {
    overflow-x: hidden;
    width: 100%;
}

.flex-1 {
    min-width: 0; /* Penting agar flex child bisa mengecil di bawah lebar kontennya */
}

/* Container Tabel Responsif */
.table-responsive,
.datatable-container {
    overflow-x: auto !important;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

/* Pastikan tabel di dalam container tidak memaksa container membesar */
table {
    width: 100% !important;
}

.datatable-wrapper {
    width: 100%;
}

.datatable-top,
.datatable-bottom {
    padding: 1rem !important;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .datatable-top,
    .datatable-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .datatable-search {
        margin: 0 !important;
        width: 100%;
    }

    .datatable-input {
        width: 100% !important;
    }

    .datatable-selector {
        width: 100%;
    }

    /* Zoom out tabel sedikit di mobile agar lebih banyak data terlihat */
    .table-modern td, .table-modern th {
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
    }
    
    .dataTable-table {
        min-width: 600px; /* Force scroll alih-alih merusak layout */
    }
}

/* --- Global Stacking Order --- */
#sidebarOverlay {
    z-index: 40;
}

#sidebar {
    z-index: 45;
}

.sticky.top-0 {
    z-index: 30; /* Keep topbar or sticky headers below sidebar/overlay */
}

/* Ensure modals are always on top */
#formModal, 
.swal2-container {
    z-index: 1060 !important;
}


/* --- Input Nilai Page Specific Styles --- */
.input-nilai-page .form-check-input {
    transform: scale(1.5);
    margin-right: 0.5rem;
    margin-left: 0.15rem;
    cursor: pointer;
}

.input-nilai-page .form-check-label {
    cursor: pointer;
    vertical-align: middle;
}

.input-nilai-page .form-check {
    display: flex;
    align-items: center;
}

/* --- New UI Enhancements (Premium Design) --- */

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 12px;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.info-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 2px;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

/* --- Global Modern Table Styles (Premium) --- */
.table-responsive,
.datatable-container {
    overflow-x: auto !important;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Gradient Table Head */
thead tr {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6) !important;
}

thead th {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.75rem !important;
    padding: 1rem 1.25rem !important;
    border: none !important;
    white-space: nowrap;
}

/* Simple-DataTables Header Fix */
.dataTable-table thead th a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.dataTable-wrapper .dataTable-top,
.dataTable-wrapper .dataTable-bottom {
    padding: 1rem 0;
}

/* Table Body Styles */
tbody td {
    padding: 0.875rem 1.25rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.875rem;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none !important;
}

/* Hover Effect */
tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background-color: #f8fafc !important;
}

tbody tr:hover td {
    color: #1e3a8a !important;
}

/* DataTables Sorting Icons Color */
.dataTable-sorter::before,
.dataTable-sorter::after {
    color: rgba(255, 255, 255, 0.5) !important;
}

@media (max-width: 768px) {
    thead th {
        padding: 0.75rem 1rem !important;
        font-size: 0.7rem !important;
    }
    
    tbody td {
        padding: 0.75rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    .dataTable-table {
        min-width: 600px;
    }
}

/* --- New UI Enhancements (Premium Design) --- */

/* --- Session Card Design --- */
.session-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.session-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.session-card .card-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.session-card .session-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.session-card .session-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.session-card .session-status {
    margin-top: auto;
}

/* Detail Modal Styles */
#modalSesiDetail .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#modalSesiDetail .modal-header {
    background: #f8fafc;
    border-top-right-radius: 20px;
    border-top-left-radius: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
}

#modalSesiDetail .detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

#modalSesiDetail .detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 1.25rem;
}

#modalSesiDetail .detail-card-inner {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 12px;
}

/* Animation for Irregularity Indicator */
.pulse-red {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Animation for Jadwal Download Button */
.pulse-green {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* --- TomSelect Tailwind & Flowbite Styling Overrides --- */
.ts-wrapper {
    width: 100% !important;
}

.ts-control {
    border-radius: 0.5rem !important; /* 8px - rounded-lg */
    border: 1px solid #d1d5db !important; /* border-gray-300 */
    padding: 0.5rem 0.75rem !important; /* py-2 px-3 */
    font-size: 0.875rem !important; /* text-sm */
    line-height: 1.25rem !important;
    background-color: #ffffff !important;
    color: #1f2937 !important; /* text-gray-900 */
    box-shadow: none !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    display: flex !important;
    align-items: center !important;
    min-height: 38px !important;
}

.ts-wrapper.focus .ts-control {
    border-color: #3b82f6 !important; /* focus:border-blue-500 */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important; /* focus:ring-blue-500/20 */
}

.ts-dropdown {
    border-radius: 0.5rem !important;
    border: 1px solid #e5e7eb !important; /* border-gray-200 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important; /* shadow-lg */
    margin-top: 4px !important;
    z-index: 1060 !important; /* Di atas modal standard (z-50) */
    font-size: 0.875rem !important;
}

.ts-dropdown .option {
    padding: 0.5rem 0.75rem !important;
    cursor: pointer;
}

.ts-dropdown .active {
    background-color: #eff6ff !important; /* bg-blue-50 */
    color: #1e40af !important; /* text-blue-800 */
}

.ts-dropdown .optgroup-header {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #6b7280 !important; /* text-gray-500 */
    background-color: #f9fafb !important; /* bg-gray-50 */
    padding: 0.375rem 0.75rem !important;
}

/* Sembunyikan tanda panah bawaan jika ter-double */
.ts-wrapper.single .ts-control::after {
    border-color: #9ca3af transparent transparent transparent !important; /* text-gray-400 */
    border-width: 5px 5px 0 5px !important;
    right: 12px !important;
}

.ts-wrapper.single.input-active .ts-control::after {
    border-color: transparent transparent #9ca3af transparent !important;
    border-width: 0 5px 5px 5px !important;
}

/* ==========================================================================
   GREEN EMERALD GOLD ISLAMIC THEME SYSTEM-WIDE OVERRIDES (FOR ADMIN PAGES)
   ========================================================================== */

/* 1. Global Background and Fonts */
body {
    background-color: #fcfbf9 !important; /* Elegant Cream background */
}

/* 2. Tables and Table Headers */
thead tr {
    background: linear-gradient(90deg, #022c22, #059669) !important; /* Emerald Gradient */
}
thead th, thead th a {
    color: #d4af37 !important; /* Gold text */
    font-weight: 700 !important;
    border-bottom: 2px solid #d4af37 !important;
}
tbody tr:hover {
    background-color: rgba(5, 150, 105, 0.05) !important; /* Soft Emerald hover */
}
tbody tr:hover td {
    color: #022c22 !important;
}

/* 3. Cards and Headers */
.card, .page-card, .glass-card, .bg-white.rounded-xl.shadow-sm {
    border: 1px solid rgba(212, 175, 55, 0.3) !important; /* Gold Border */
    box-shadow: 0 4px 15px rgba(2, 44, 34, 0.05) !important;
}
h2, h3, .card-title, .header-hero h3 {
    color: #022c22 !important;
}
.header-hero {
    background: linear-gradient(90deg, #022c22, #064e3b) !important; /* Deep Emerald */
    border-bottom: 2px solid #d4af37 !important;
}
.header-hero h3 {
    color: #d4af37 !important; /* Gold heading */
}
.header-hero p {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 4. Primary buttons and active states */
.btn-primary, .bg-blue-600, .bg-blue-500,
button.btn-primary, a.btn-primary {
    background-color: #059669 !important; /* Emerald */
    border-color: #059669 !important;
    color: #ffffff !important;
    transition: all 0.2s ease-in-out;
}
.btn-primary:hover, .bg-blue-600:hover, .bg-blue-500:hover {
    background-color: #042a1d !important; /* Deep Emerald */
    border-color: #042a1d !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
}

/* 5. Warning / Info / Secondary accents */
.text-primary, .text-blue-600 {
    color: #059669 !important;
}
.border-primary, .border-blue-500 {
    border-color: #d4af37 !important;
}
.bg-blue-50, .bg-blue-100 {
    background-color: rgba(5, 150, 105, 0.08) !important;
    color: #022c22 !important;
}

/* 6. Form inputs focus ring & global text styling */
input:focus, select:focus, textarea:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}
.ts-wrapper.focus .ts-control {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}
.ts-dropdown .active {
    background-color: rgba(5, 150, 105, 0.08) !important;
    color: #022c22 !important;
}

/* 7. Form Inputs & Select Elements Islamic Styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="search"],
select,
textarea {
    background-color: #ffffff !important;
    border: 1px solid rgba(5, 150, 105, 0.3) !important; /* Soft Emerald border */
    color: #022c22 !important; /* Deep Emerald text */
    border-radius: 0.5rem !important;
    transition: all 0.2s ease-in-out !important;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
    border-color: #059669 !important; /* Emerald on hover */
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #d4af37 !important; /* Gold on focus */
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important; /* Gold focus ring */
    outline: none !important;
}

/* Styled Checkbox */
input[type="checkbox"] {
    border: 1.5px solid rgba(5, 150, 105, 0.4) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease-in-out !important;
}

input[type="checkbox"]:checked {
    background-color: #059669 !important;
    border-color: #d4af37 !important;
}

input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}

/* Table Search Input overrides (Simple-DataTables and generic search) */
.dataTable-input,
.dataTable-selector {
    background-color: #ffffff !important;
    border: 1px solid rgba(5, 150, 105, 0.3) !important;
    color: #022c22 !important;
}

.dataTable-input:focus,
.dataTable-selector:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}

/* Modals forms background styling */
.modal-content, #formModal > div {
    background-color: #fcfbf9 !important; /* Matching Cream background */
}


