
/* General Body Styles */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Theme */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .navbar {
    background-color: #1f1f1f !important;
}

body.dark-theme .card {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-theme .list-group-item {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-theme .modal-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: #252525;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-theme .form-control::placeholder {
    color: #888;
}

body.dark-theme .input-group-text {
    background-color: #333;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .dropdown-menu {
    background-color: #2a2a2a;
}

body.dark-theme .dropdown-item {
    color: #e0e0e0;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background-color: #333;
}

body.dark-theme .text-muted {
    color: #aaa !important;
}

body.dark-theme .bg-light {
    background-color: #1e1e1e !important;
}

body.dark-theme footer.bg-light {
    background-color: #1f1f1f !important;
}

/* Arabic Font Styles */
.arabic-text, .ayah-text-arabic, .surah-card .text-primary {
    font-family: 'Scheherazade New', serif;
    font-size: 1.8rem;
    line-height: 2.5;
    direction: rtl;
    text-align: right;
}

.surah-card .text-primary {
    font-size: 1.5rem;
}

/* Surah Card Styles */
.surah-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.surah-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.surah-card.completed {
    border-left: 5px solid #198754; /* Green border for completed */
}

.surah-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6c757d;
}

/* Ayah Card Styles */
.ayah-card.highlight {
    background-color: rgba(255, 255, 0, 0.2);
    transition: background-color 0.5s;
}

.ayah-card.ayah-playing {
    background-color: rgba(255, 255, 0, 0.15);
    border-left: 4px solid #ffc107;
}

.mark-as-read-btn.marked {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

/* Scroll to Top Button */
#scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 99;
    width: 50px;
    height: 50px;
}

/* Toast Container */
#toast-container {
    z-index: 1100;
}

/* Floating Audio Player */
#floating-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background-color: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 15px;
    padding: 10px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease-in-out;
}

body.dark-theme #floating-player {
    background-color: #2a2a2a;
    border-color: #444;
}

#floating-player.d-none {
    transform: translateX(-50%) translateY(150%);
}

#floating-player progress {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background-color: #e9ecef;
    border: none;
}

body.dark-theme #floating-player progress {
    background-color: #444;
}

#floating-player progress::-webkit-progress-bar {
    background-color: #e9ecef;
    border-radius: 5px;
}
body.dark-theme #floating-player progress::-webkit-progress-bar {
    background-color: #444;
}

#floating-player progress::-webkit-progress-value {
    background-color: #ffc107; /* Yellow progress */
    border-radius: 5px;
    transition: width 0.1s linear;
}

#floating-player progress::-moz-progress-bar {
    background-color: #ffc107; /* Yellow progress */
    border-radius: 5px;
    transition: width 0.1s linear;
}

#floating-player-toggle-btn, #floating-player-stop-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Kalender Final Design (Image-Inspired) --- */

.calendar-legend {
    background-color: #f8f9fa; /* Light background for the legend */
    padding: 1rem;
    border-top: 1px solid #eee;
    border-radius: 0 0 8px 8px; /* Rounded bottom corners */
    margin-top: 1rem;
}

body.dark-theme .calendar-legend {
    background-color: #2a2a2a;
    border-color: #444;
}
.calendar-design-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.calendar-main-header {
    display: flex;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
    justify-content: space-between; /* Added for button spacing */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.calendar-main-header .btn {
    flex-shrink: 0; /* Prevent buttons from shrinking */
    border: none;
    background-color: transparent;
    color: var(--bs-primary);
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
}

.calendar-main-header .btn:hover {
    background-color: var(--bs-gray-200);
}

#today-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--bs-secondary);
    color: white;
}

.day-header-tag {
    color: white;
    border-radius: 6px;
    padding: 0.5rem 0;
    font-weight: 600;
    margin: 0 0.25rem;
}

/* Mobile adjustments for calendar header */
@media (max-width: 768px) {
    .mobile-break {
        display: block !important; /* Show line break on mobile */
    }

    .calendar-main-header {
        flex-direction: column; /* Stack items vertically */
        align-items: stretch; /* Stretch items to full width */
        padding: 0.5rem; /* Reduce padding */
        position: relative; /* Establish positioning context for absolute children */
        height: auto; /* Allow height to adjust */
    }

    .calendar-main-header .btn {
        font-size: 1.2rem; /* Smaller navigation arrows */
        padding: 0.25rem;
    }

    #today-btn,
    .form-check.form-switch.ms-3 {
        width: 100%; /* Make buttons and toggle full width */
        margin-top: 0.5rem; /* Add some spacing */
        margin-left: 0 !important; /* Override ms-3 */
        text-align: center;
    }

    .calendar-title-group {
        flex-direction: column; /* Stack month and year vertically */
        margin: 0.5rem 0; /* Adjust margin */
        align-items: center; /* Center content */
        order: 1; /* Place title group first in column layout */
    }

    .gregorian-display {
        display: flex; /* Use flex to keep month number, name, year on one line */
        align-items: baseline;
        justify-content: center;
        font-size: 1.1rem !important; /* Consistent font size for Gregorian part */
        color: #666 !important; /* Consistent color */
        flex-wrap: wrap; /* Allow wrapping if content is too long */
    }

    .gregorian-display .month-number,
    .gregorian-display .month-name,
    .gregorian-display .year-gregorian {
        font-size: 1.1rem !important; /* Consistent font size */
        color: #666 !important; /* Consistent color */
        margin: 0 0.1rem; /* Adjust spacing */
    }

    .gregorian-display .month-number {
        color: #c00 !important; /* Keep month number red */
    }

    .hijri-display {
        display: block !important; /* Ensure Hijri is on its own line */
        text-align: center;
        font-size: 1rem !important; /* Smaller Hijri month font */
        color: #555 !important;
        margin-top: 0.2rem; /* Space from Gregorian part */
    }

    .hijri-month-prominent {
        font-size: 1rem !important; /* Smaller Hijri month font */
        margin-left: 0 !important; /* Remove left margin */
        text-align: center !important; /* Center Hijri text */
        width: 100% !important; /* Ensure it takes full width if needed */
        order: 3 !important; /* This order is for within calendar-title-group, but hijri-display is now the direct child */
    }

    /* Adjust positioning of prev/next buttons */
    #prev-month-btn {
        position: absolute;
        left: 0.5rem;
        top: 0.5rem;
        order: 0; /* Place before title group */
    }
    #next-month-btn {
        position: absolute;
        right: 0.5rem;
        top: 0.5rem;
        order: 0; /* Place before title group */
    }

    #today-btn {
        order: 2; /* Place after title group */
    }

    .form-check.form-switch.ms-3 {
        order: 3; /* Place last */
    }
}
.calendar-title-group {
    flex-grow: 1;
    text-align: center;
    display: flex;
    flex-direction: row; /* Changed to row for inline display */
    align-items: baseline; /* Align text baselines */
    justify-content: center;
    margin: 0 1rem; /* Space between buttons and title */
}
.calendar-main-header .month-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c00;
    margin-right: 0.5rem; /* Adjusted margin */
}
.calendar-main-header .month-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}
.calendar-main-header .year-gregorian {
    font-size: 1.5rem; /* Smaller than month name */
    font-weight: 500;
    color: #666;
    margin-left: 0.5rem;
}
.hijri-month-prominent {
    font-size: 1.2rem; /* More prominent than before */
    color: #555;
    margin-left: 1rem; /* Space from Gregorian year */
    font-weight: 500;
}
.calendar-table-redesign {
    width: 100%;
    border-collapse: collapse;
}
.day-headers th {
    padding: 0;
    border: 0;
    text-align: center;
}
.day-header-tag {
    color: white;
    border-radius: 6px;
    padding: 0.5rem 0;
    font-weight: 600;
    margin: 0 0.25rem;
}
.day-header-tag .arabic-day {
    display: block;
    font-size: 0.9rem;
    margin-top: 2px;
    opacity: 0.8;
}
.day-header-tag.day-0 { background-color: #d9534f; } /* Ahad - Red */
.day-header-tag.day-1 { background-color: #5bc0de; } /* Senin - Blue */
.day-header-tag.day-2 { background-color: #5bc0de; }
.day-header-tag.day-3 { background-color: #5bc0de; }
.day-header-tag.day-4 { background-color: #5bc0de; }
.day-header-tag.day-5 { background-color: #5cb85c; } /* Jumat - Green */
.day-header-tag.day-6 { background-color: #5bc0de; }

.calendar-table-redesign td {
    padding: 0.5rem;
    height: 90px;
    width: 14.28%;
    text-align: center;
    position: relative;
    border: 1px solid #eee;
}
.calendar-table-redesign td.empty-day {
    border: 1px solid #fdfdfd;
    background: #fdfdfd;
}
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    text-align: center;
}
td.sunday .gregorian-number {
    color: #d9534f;
}
td.friday .gregorian-number {
    color: #5cb85c; /* Green color for Fridays */
}
.hijri-number-corner {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    color: #888;
}

.day-indicators {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.indicator-event {
    background-color: #007bff; /* Blue for events */
}

.indicator-fasting {
    background-color: #28a745; /* Green for fasting */
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
}

/* Highlight for today's date - Made more prominent */
.calendar-table-redesign td.today {
    background-color: #fff3cd; /* A more visible yellow */
    border-color: #ffc107; /* Stronger border */
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}
