/* =========================================
   1. Page & Header Layout
   ========================================= */
.azkar-page {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.page-header-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.instruction-text {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* =========================================
   2. Accordion (Categories)
   ========================================= */
.accordion-header {
    position: relative;
    border-bottom: 1px solid var(--nav-border);
    margin-bottom: 2px;
}

.accordion-btn {
    background-color: var(--nav-bg);
    color: var(--primary-green);
    cursor: pointer;
    /* Padding: Top Right Bottom Left */
    /* Increased Right padding (60px) to make room for the absolute Category Reset button */
    padding: 18px 60px 18px 18px; 
    width: 100%;
    border: none;
    text-align: right; /* RTL alignment */
    outline: none;
    font-size: 1.2rem;
    font-weight: bold;
    transition: 0.4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active, .accordion-btn:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Arrow rotation logic */
.accordion-btn .arrow-icon {
    transition: transform 0.3s;
}
.accordion-btn.active .arrow-icon {
    transform: rotate(180deg);
}

/* Category Reset Button (The one in the header) */
.cat-reset-btn {
    position: absolute;
    right: 15px; /* Positioned near the text start in RTL */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
}

/* Note: In RTL, right is the start. If you want it next to the arrow (left side), change 'right' to 'left' */
.cat-reset-btn {
    right: auto;
    left: 50px; /* Positions it to the right of the arrow icon */
}

.cat-reset-btn img {
    width: 30px;
    height: 30px;
    opacity: 0.6;
    transition: 0.2s;
}

.cat-reset-btn:hover img {
    opacity: 1;
    transform: rotate(-180deg);
}

.panel {
    padding: 0 5px;
    display: none; /* Hidden by default */
    background-color: transparent;
    overflow: hidden;
    margin-bottom: 15px;
}

/* =========================================
   3. The Azkar Table (Grid Layout)
   ========================================= */
.azkar-row {
    display: grid;
    /* Grid Columns Setup (RTL Direction):
       1. Col-Counter (Right): 120px fixed (Fits Reset Icon + Circle)
       2. Col-Text (Middle): 1fr (Flexible space)
       3. Col-Actions (Left): 180px fixed (Fits social icons)
    */
    grid-template-columns: 120px 1fr 180px; 
    align-items: center;
    background-color: var(--nav-bg);
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--nav-border);
    transition: background-color 0.3s ease;
}

/* Completed State Highlight */
.azkar-row.completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
}
/* Dark Mode Override for Completed State */
[data-theme="dark"] .azkar-row.completed {
    background-color: #155724;
    color: #fff;
}

/* --- Column 1: Counter & Reset Icon --- */
.col-counter {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* In RTL, this aligns to the Right */
    gap: 12px;
}

/* The Reset Button inside the row */
.row-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
}

.row-reset-btn img {
    width: 30px;
    height: 30px;
    opacity: 0.4;
    transition: 0.2s;
}

.row-reset-btn:hover img {
    opacity: 1;
    transform: rotate(-180deg);
}

.count-circle {
    width: 50px;
    height: 50px;
    background-color: var(--primary-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0; /* Prevents circle from getting squashed */
    transition: transform 0.1s;
}

/* --- Column 2: The Zikr Text --- */
.col-text {
    font-size: 1.2rem;
    line-height: 1.8;
    cursor: pointer;
    user-select: none;
    
    /* VITAL: Padding prevents overlap with adjacent columns */
    padding-right: 15px; /* Buffer from Counter */
    padding-left: 20px;  /* Buffer from Social Icons */
}

/* --- Column 3: Social Actions --- */
.col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end; /* Aligns icons to the Left in RTL */
}

.col-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s;
}

.col-actions button:hover {
    transform: scale(1.1);
}

.col-actions img {
    width: 30px;
    height: 30px;
}

/* =========================================
   4. Mobile Responsiveness
   ========================================= */
@media (max-width: 768px) {
    .azkar-row {
        /* Stack vertically on mobile */
        grid-template-columns: 1fr; 
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    .col-counter {
        justify-content: center; /* Center the circle and reset icon */
    }

    .col-text {
        /* Remove side padding on mobile as elements are stacked */
        padding-right: 0;
        padding-left: 0;
        font-size: 1.1rem;
    }

    .col-actions {
        justify-content: center;
        border-top: 1px solid var(--nav-border);
        padding-top: 15px;
        flex-wrap: wrap; /* Allow wrapping if screen is very small */
    }
}