.fasting-banner {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(201, 169, 89, 0.1) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--gold);
}

.fasting-banner-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fasting-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    min-width: 120px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.fasting-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.fasting-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

#fasting-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fasting-badge {
    background: rgba(201, 169, 89, 0.15);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Sections */
.fasting-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.fasting-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.fasting-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Forms */
.fasting-form {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.fasting-form select,
.fasting-form input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
}

/* Debts */
.fasting-cards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#fasting-add-debt-btn {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.fasting-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.fasting-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.fasting-debt-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem;
    border-right: 4px solid #e74c3c;
    transition: all 0.3s ease;
}

.fasting-debt-card.completed {
    border-right-color: #27ae60;
    opacity: 0.8;
}

.fasting-debt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.fasting-debt-header strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.fasting-debt-note {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 600;
}

.fasting-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: 0.2s;
}

.fasting-delete-btn:hover {
    opacity: 1;
    color: #e74c3c;
}

.fasting-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.fasting-progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.03); /* Faint gray instead of yellow-ish border color */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.fasting-progress-fill {
    height: 100%;
    background: #e74c3c;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.fasting-progress-fill.complete {
    background: #27ae60;
}

.fasting-progress-text {
    font-weight: 700;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    min-width: 45px;
    text-align: left;
}

.fasting-complete-msg {
    color: #27ae60;
    font-weight: bold;
    margin: 0;
    text-align: center;
    padding: 8px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
}

/* Interactive Calendar */
.fasting-calendar-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.fasting-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.fasting-calendar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--gold);
}

.fasting-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.fasting-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.fasting-cal-cell {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 80px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.fasting-cal-cell.today {
    border: 2px solid var(--accent-color) !important;
    background: rgba(212, 175, 55, 0.1) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.fasting-cal-cell.today::after {
    content: 'اليوم';
    position: absolute;
    bottom: -8px;
    right: 50%;
    transform: translateX(50%);
    background: var(--accent-color);
    color: white;
    font-size: 0.6rem;
    padding: 0 5px;
    border-radius: 10px;
    z-index: 2;
}

.fasting-cal-cell:hover:not(.empty):not(.future):not(.logged) .fasting-cal-add-hint {
    opacity: 0.5;
}

.fasting-cal-cell:hover:not(.empty):not(.future) {
    border-color: var(--gold);
    box-shadow: 0 4px 10px rgba(201, 169, 89, 0.15);
    background: linear-gradient(to bottom, var(--bg-color), rgba(201, 169, 89, 0.05));
    transform: translateY(-2px);
}

.fasting-cal-cell.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.fasting-cal-cell.future {
    opacity: 0.5;
    background: #fdfdfd;
    cursor: not-allowed;
}

[data-theme="dark"] .fasting-cal-cell.future {
    background: #252528;
}

.fasting-cal-num {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.fasting-cal-cell-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.fasting-cal-hijri {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(201, 169, 89, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.fasting-cal-add-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fasting-cal-dots {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fasting-cal-weekday {
    display: none;
}

.fasting-cal-date-grp {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.fasting-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot-debt {
    background: #e74c3c;
}

.dot-periodic {
    background: #27ae60;
}

.dot-seasonal {
    background: var(--gold);
}

/* Fasting Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal:not(.hidden) {
    display: flex;
    animation: fadeInModalBg 0.3s ease-out forwards;
}

.modal:not(.hidden) .modal-content {
    animation: popInModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeInModalBg {
    from { background: rgba(0, 0, 0, 0); }
    to { background: rgba(0, 0, 0, 0.6); }
}

@keyframes popInModal {
    from { opacity: 0; transform: scale(0.85) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal.closing {
    animation: fadeOutModalBg 0.3s ease-in forwards;
}

.modal.closing .modal-content {
    animation: popOutModal 0.3s ease-in forwards;
}

@keyframes fadeOutModalBg {
    from { background: rgba(0, 0, 0, 0.6); }
    to { background: rgba(0, 0, 0, 0); }
}

@keyframes popOutModal {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.9) translateY(10px); }
}

.fasting-modal-content {
    max-width: 500px;
}

.fasting-modal-date {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

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

#fasting-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#fasting-modal .close-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

#fasting-modal .close-modal:hover {
    color: #e74c3c;
}

.fasting-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme="dark"] .fasting-opt-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .fasting-opt-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fasting-opt-btn {
    width: 100%;
    text-align: right;
    padding: 12px 15px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-debt {
    border-right: 4px solid #e74c3c;
    border-left: none;
}

.btn-periodic {
    border-right: 4px solid #27ae60;
    border-left: none;
}

.btn-seasonal {
    border-right: 4px solid var(--gold);
    border-left: none;
}

.fasting-modal-existing {
    background: rgba(39, 174, 96, 0.05);
    padding: 15px;
    border-radius: 8px;
    border-right: 3px solid #27ae60;
}

.fasting-logged-item {
    font-weight: bold;
    color: var(--text-primary);
    margin-top: 5px;
}

/* Confetti */
.fasting-confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    z-index: 9999;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

@media (max-width: 768px) {
    .fasting-calendar-grid {
        gap: 3px;
        grid-template-columns: repeat(5, 1fr);
    }

    .fasting-cal-cell {
        height: 60px;
        padding: 3px;
        min-width: 40px;
    }

    .fasting-calendar-days-header {
        font-size: 0.75rem;
        gap: 3px;
        grid-template-columns: repeat(7, 1fr);
    }

    .fasting-cal-num {
        font-size: 0.9rem;
    }

    .fasting-cal-hijri {
        font-size: 0.60rem;
        padding: 1px 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fasting-cal-add-hint {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .fasting-calendar-grid {
        gap: 3px;
        grid-template-columns: repeat(4, 1fr);
    }

    .fasting-cal-cell {
        height: 65px;
        padding: 4px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: relative;
    }

    .fasting-cal-cell-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .fasting-cal-num {
        font-size: 0.85rem;
        font-weight: bold;
    }

    .fasting-cal-hijri {
        font-size: 0.55rem;
        padding: 1px 4px;
        display: block;
        align-self: flex-end;
    }

    /* Hide standard headers that don't align with 4 columns */
    .fasting-calendar-days-header {
        display: none;
    }

    /* Hide lead-in empty cells */
    .fasting-cal-cell.empty {
        display: none;
    }

    /* Show the weekday name inside the cell - on same line as num */
    .fasting-cal-weekday {
        display: inline-block;
        font-size: 0.65rem;
        color: var(--gold);
        font-weight: bold;
    }

    .fasting-cal-date-grp {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.dot-nafl {
    background-color: #3498db;
}

/* Siyam Tatawoo Gray/White */

/* Force Number Input Spinners for Fasting Forms */
.fasting-form input[type='number']::-webkit-inner-spin-button,
.fasting-form input[type='number']::-webkit-outer-spin-button,
.inline-edit-form input[type='number']::-webkit-inner-spin-button,
.inline-edit-form input[type='number']::-webkit-outer-spin-button,
#debt-days-input::-webkit-inner-spin-button,
#debt-days-input::-webkit-outer-spin-button {
    -webkit-appearance: inner-spin-button !important;
    appearance: inner-spin-button !important;
    display: block !important;
    opacity: 1 !important;
    height: auto !important;
}

.fasting-form input[type='number'],
.inline-edit-form input[type='number'],
#debt-days-input {
    -moz-appearance: number-input !important;
    appearance: auto !important;
}
