/* Dhikr Counter Specific Styles - Following Prayer Times Design Language */



/* Dhikr Card Display */
.dhikr-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dhikr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.dhikr-card:hover::before {
    left: 100%;
}

.dhikr-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow), var(--glow);
}

.dhikr-text {
    position: relative;
    z-index: 2;
}

.dhikr-arabic {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.dhikr-transliteration {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.dhikr-translation {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.dhikr-meaning,
.dhikr-reward {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Counter Section */
.counter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.counter-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
}

.progress-ring__circle,
.progress-ring__circle-bg {
    transition: all 0.3s ease;
}

.progress-ring__circle {
    stroke-dasharray: 879.646; /* 2 * π * 140 */
    stroke-dashoffset: 879.646;
    animation: progress-glow 2s ease-in-out infinite alternate;
}

@keyframes progress-glow {
    0% {
        filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.8));
    }
}

.tap-button {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 3px solid var(--border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.2),
        inset 0 -2px 10px rgba(0,0,0,0.1),
        inset 0 2px 10px rgba(255,255,255,0.1);
    transition: all 0.2s ease;
    user-select: none;
}

.tap-button:hover {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.25),
        0 0 20px var(--glow),
        inset 0 -2px 10px rgba(0,0,0,0.1),
        inset 0 2px 10px rgba(255,255,255,0.1);
}

.tap-button:active {
    transform: scale(0.98);
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.3),
        inset 0 2px 10px rgba(0,0,0,0.2);
}

.count-display {
    text-align: center;
    margin-bottom: 8px;
}

.count-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.count-target {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tap-instruction {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.8;
}

.today-stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Controls Row */
.controls-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.control-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
}

.control-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); /* Even smaller min-width */
    gap: 10px;
    flex-wrap: wrap; /* Ensure wrapping */
    justify-content: center; /* Center items if they don't fill the row */
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Adjusted min-width for more columns */
    gap: 15px; /* Adjusted gap for tighter packing */
}

.stat-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Stat Card Progress Fill (for daily goal and streak) */
.stat-card-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.15) 0%, 
        rgba(59, 130, 246, 0.25) 50%,
        rgba(59, 130, 246, 0.15) 100%);
    border-right: 2px solid rgba(59, 130, 246, 0.5);
    transition: width 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.stat-card-progress-fill.completed {
    background: linear-gradient(90deg, 
        rgba(16, 185, 129, 0.15) 0%, 
        rgba(16, 185, 129, 0.25) 50%,
        rgba(16, 185, 129, 0.15) 100%);
    border-right: 2px solid rgba(16, 185, 129, 0.6);
}

.stats-modal-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    text-align: center; /* Center content within the card */
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.stats-modal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.stat-info {
    flex: 1;
    position: relative;
    z-index: 2;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Week Segments for Streak Card */
.streak-card {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 12px;
}

.streak-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.streak-card .stat-icon,
.streak-card .stat-info {
    z-index: 2;
}

.streak-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.week-segments {
    display: flex;
    gap: 4px;
    width: 100%;
    margin-top: 12px;
    z-index: 2;
}

.day-segment {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

/* Day with no dhikr - empty/grey */
.day-segment:not(.active) {
    background: var(--bg-secondary);
    border: 2px solid transparent;
}

/* Day with dhikr but goal not completed - blue filled */
.day-segment.active:not(.goal-completed) {
    background: linear-gradient(90deg, var(--accent), var(--accent-glow, #60a5fa));
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    border: 2px solid transparent;
}

/* Day with dhikr AND goal completed - green filled */
.day-segment.goal-completed {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    border: 2px solid transparent;
}

/* Today indicator - cyan border */
.day-segment.today {
    border: 2px solid #7affd3;
    border-radius: 4px;
    height: 8px;
}

/* Today with no dhikr - cyan border + grey fill */
.day-segment.today:not(.active) {
    background: var(--bg-secondary);
    border: 2px solid #7affd3;
    box-shadow: 0 0 10px rgba(144, 255, 218, 0.4);
}

/* Today with dhikr but goal not completed - cyan border + blue fill */
.day-segment.today.active:not(.goal-completed) {
    background: linear-gradient(90deg, var(--accent), var(--accent-glow, #60a5fa));
    border: 2px solid #7affd3;
    box-shadow: 0 0 10px rgba(144, 255, 218, 0.5), 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Today with goal completed - cyan border + green fill */
.day-segment.today.goal-completed {
    background: linear-gradient(90deg, #10b981, #34d399);
    border: 2px solid #7affd3;
    box-shadow: 0 0 12px rgba(144, 255, 218, 0.8);
}

.day-segment:hover {
    transform: scaleY(1.5);
}

/* Dhikr Selection */
.dhikr-selection {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dhikr-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 45px 12px 15px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.dhikr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dhikr-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dhikr-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.dhikr-option:hover::before {
    left: 100%;
}

.dhikr-option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
}

.dhikr-option.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.1) 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.dhikr-option-content {
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.dhikr-arabic-small {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.dhikr-name {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    font-size: 1rem;
}

/* Dhikr Card Count Display */
.dhikr-count-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px 0;
}

/* Dhikr Card Full Background Progress Fill */
.dhikr-option {
    position: relative;
    overflow: hidden;
}

.dhikr-card-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.15) 0%, 
        rgba(59, 130, 246, 0.25) 50%,
        rgba(59, 130, 246, 0.15) 100%);
    border-right: 2px solid rgba(59, 130, 246, 0.5);
    transition: width 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.dhikr-card-progress-fill.completed {
    background: linear-gradient(90deg, 
        rgba(16, 185, 129, 0.15) 0%, 
        rgba(16, 185, 129, 0.25) 50%,
        rgba(16, 185, 129, 0.15) 100%);
    border-right: 2px solid rgba(16, 185, 129, 0.6);
    animation: pulse-fill 1.5s ease-in-out infinite;
}

@keyframes pulse-fill {
    0%, 100% {
        background: linear-gradient(90deg, 
            rgba(16, 185, 129, 0.15) 0%, 
            rgba(16, 185, 129, 0.25) 50%,
            rgba(16, 185, 129, 0.15) 100%);
    }
    50% {
        background: linear-gradient(90deg, 
            rgba(16, 185, 129, 0.2) 0%, 
            rgba(16, 185, 129, 0.35) 50%,
            rgba(16, 185, 129, 0.2) 100%);
    }
}

.dhikr-target {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Target Input Styles */
.dhikr-target-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
}

.dhikr-target-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.dhikr-target-display:hover {
    background: rgba(59, 130, 246, 0.1);
}

.dhikr-custom-target-input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.dhikr-custom-target-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

.edit-target-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.edit-target-btn:hover {
    background: var(--accent-glow);
}


/* Expandable Dhikr Cards */
.dhikr-option.expanded {
    min-height: auto; /* Remove fixed min-height */
    height: auto; /* Allow natural height expansion */
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.1) 100%);
    box-shadow: var(--shadow), var(--glow);
    animation: dhikr-glow 2s ease-in-out infinite alternate;
}

@keyframes dhikr-glow {
    from {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

/* Expanded card content - hidden by default */
.dhikr-details {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    margin-top: 0;
}

.dhikr-option.expanded .dhikr-details {
    max-height: none; /* Remove height restriction */
    opacity: 1;
    margin-top: 20px;
    overflow: visible; /* Allow content to show */
}

.dhikr-expanded-meaning,
.dhikr-expanded-reward,
.dhikr-expanded-translation {
    background: rgba(59, 130, 246, 0.1);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent);
}

.dhikr-expanded-meaning h4,
.dhikr-expanded-reward h4,
.dhikr-expanded-translation h4 {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dhikr-expanded-meaning p,
.dhikr-expanded-reward p,
.dhikr-expanded-translation p {
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5; /* Increased line height for better readability */
    margin: 0;
    word-wrap: break-word; /* Ensure long words break properly */
    hyphens: auto; /* Enable automatic hyphenation */
    white-space: normal; /* Ensure text wraps normally */
}

/* Add expansion hint */
.dhikr-option:not(.expanded)::after {
    content: 'Double-click or right-click to expand';
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dhikr-option:hover:not(.expanded)::after {
    opacity: 0.7;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow), var(--glow);
    animation: slideIn 0.3s ease;
    position: absolute; /* Added for precise centering */
    top: 50%; /* Added for precise centering */
    left: 50%; /* Added for precise centering */
    transform: translate(-50%, -50%); /* Added for precise centering */
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

/* Settings Styles */
.settings-grid {
    display: grid;
    gap: 30px;
}

.setting-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
}

.setting-group h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-weight: 500;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 25px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(25px);
}

/* Form Inputs */
.number-input, .time-input, .select-input {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.number-input:focus, .time-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.modal-actions > button,
.modal-actions > .export-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
}

.modal-actions > button {
    white-space: nowrap;
}

.modal-actions .btn {
    min-width: 0 !important;
    flex: 1 !important;
}

.export-wrapper {
    display: flex;
    align-items: stretch;
    background: var(--accent);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.export-wrapper .export-btn {
    flex: 1;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 12px 15px !important;
    background: var(--accent) !important;
    min-width: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

.export-wrapper .export-btn:hover {
    background: var(--accent-hover) !important;
    opacity: 0.9;
    transform: none;
    box-shadow: none;
}

.export-wrapper .export-period-select {
    padding: 10px 28px 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    white-space: nowrap;
}

.export-wrapper .export-period-select:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.export-wrapper .export-period-select:focus {
    background-color: rgba(0, 0, 0, 0.3);
}

.export-wrapper .export-period-select option {
    background: var(--bg-card);
    color: var(--text);
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.btn:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn.secondary:hover {
    background: var(--border);
    border-color: var(--accent);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent);
}

/* Desktop Button Layout - Different sizes */
@media (min-width: 769px) {
    .modal-actions #viewStatsBtn {
        flex: 0.8 !important;
    }
    
    .modal-actions .export-wrapper {
        flex: 1.6 !important;
    }
    
    .modal-actions #resetAllBtn {
        flex: 0.6 !important;
    }
}

/* Mobile Button Layout - Stack vertically */
@media (max-width: 768px) {
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions > button,
    .modal-actions > .export-wrapper {
        flex: none !important;
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dhikr-container {
        padding: 15px;
        gap: 25px;
    }
    
    .counter-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .progress-ring {
        width: 250px;
        height: 250px;
        filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
    }
    
    .progress-ring__circle, 
    .progress-ring__circle-bg {
        r: 115; /* Adjusted radius for smaller screen */
        stroke-width: 5px; /* Slightly thinner stroke */
    }
    
    .tap-button {
        width: 200px;
        height: 200px;
    }
    
    .count-number {
        font-size: 2.5rem; /* Adjust font size for smaller screens */
    }
    
    .count-target {
        font-size: 1rem; /* Adjust font size for smaller screens */
    }
    
    .dhikr-arabic {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .dhikr-search {
        max-width: none;
    }
    
    .controls-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .control-btn {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .modal {
        width: 92%;
        margin: 15px;
        max-width: 480px;
        border-radius: 15px;
    }
    
    .modal-actions {
        flex-direction: column !important;
        gap: 10px;
    }
    
    .modal-actions > button,
    .modal-actions > .export-wrapper {
        width: 100% !important;
        flex: none !important;
    }
    
    .settings-grid {
        gap: 20px;
    }
    
    /* Quick Stats Mobile Optimization */
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    /* Expandable Cards Mobile Optimization */
    .dhikr-option.expanded {
        min-height: auto; /* Remove fixed min-height */
        height: auto; /* Allow natural height expansion */
    }
    
    .dhikr-option.expanded .dhikr-details {
        max-height: none; /* Remove height restriction */
        overflow: visible; /* Allow content to show */
    }
    
    .dhikr-expanded-meaning,
    .dhikr-expanded-reward,
    .dhikr-expanded-translation {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .dhikr-expanded-meaning h4,
    .dhikr-expanded-reward h4,
    .dhikr-expanded-translation h4 {
        font-size: 0.85rem;
    }
    
    .dhikr-expanded-meaning p,
    .dhikr-expanded-reward p,
    .dhikr-expanded-translation p {
        font-size: 0.8rem;
    }
    
    .dhikr-option:not(.expanded)::after {
        font-size: 0.65rem;
        bottom: 3px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .counter-wrapper {
        width: 220px;
        height: 220px;
    }
    
    .progress-ring {
        width: 220px;
        height: 220px;
        filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.3));
    }
    
    .progress-ring__circle, 
    .progress-ring__circle-bg {
        r: 100; /* Further adjusted radius for very small screens */
        stroke-width: 4px; /* Even thinner stroke for very small screens */
    }
    
    .tap-button {
        width: 180px;
        height: 180px;
    }
    
    .count-number {
        font-size: 2rem; /* Adjust font size for very small screens */
    }
    
    .count-target {
        font-size: 0.9rem; /* Adjust font size for very small screens */
    }
    
    .tap-instruction {
        font-size: 0.8rem;
    }
    
    /* Quick Stats Very Small Screen Optimization */
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    /* Modal Very Small Screen Optimization */
    .modal {
        width: 96%;
        margin: 10px;
        max-width: 350px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    /* Expandable Cards Very Small Screen Optimization */
    .dhikr-option.expanded {
        min-height: auto; /* Remove fixed min-height */
        height: auto; /* Allow natural height expansion */
    }
    
    .dhikr-option.expanded .dhikr-details {
        max-height: none; /* Remove height restriction */
        overflow: visible; /* Allow content to show */
        margin-top: 15px;
    }
    
    .dhikr-expanded-meaning,
    .dhikr-expanded-reward,
    .dhikr-expanded-translation {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .dhikr-expanded-meaning h4,
    .dhikr-expanded-reward h4,
    .dhikr-expanded-translation h4 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .dhikr-expanded-meaning p,
    .dhikr-expanded-reward p,
    .dhikr-expanded-translation p {
        font-size: 0.75rem;
    }
    
    .dhikr-option:not(.expanded)::after {
        font-size: 0.6rem;
        bottom: 2px;
        right: 6px;
    }
}

.completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.completion-message.hide {
    animation: slideOut 0.5s ease-in forwards;
}

.completion-icon {
    font-size: 4rem;
    line-height: 1;
}

.completion-text h3 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.completion-text p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.reward-text {
    font-style: italic;
    color: var(--text-secondary);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
}

.progress-ring__circle.pulsing-glow {
    animation: pulsing-glow 1.5s infinite alternate;
}

@keyframes pulsing-glow {
    from {
        filter: drop-shadow(0 0 20px var(--accent)C0);
        stroke-width: 12px;
    }
    to {
        filter: drop-shadow(0 0 30px var(--accent)FF);
        stroke-width: 14px;
    }
}

.tap-button.counting {
    animation: tap-animation 0.2s ease-out;
}

@keyframes tap-animation {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.dhikr-option.active .dhikr-option-content {
    animation: active-dhikr-glow 1.5s infinite alternate;
}

@keyframes active-dhikr-glow {
    from {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    }
}

.progress-ring__circle.celebrate-glow {
    animation: celebrate-ring-glow 1s forwards;
}

@keyframes celebrate-ring-glow {
    0% {
        filter: drop-shadow(0 0 20px var(--accent)C0);
        stroke-width: 12px;
    }
    50% {
        filter: drop-shadow(0 0 50px var(--accent)FF);
        stroke-width: 16px;
    }
    100% {
        filter: drop-shadow(0 0 20px var(--accent)C0);
        stroke-width: 12px;
    }
}

.warning-message p {
    color: var(--danger, #ef4444); /* Using a danger variable if available, otherwise a direct red */
    font-weight: 500;
    margin-top: 10px;
}

.warning-message p a {
    color: var(--danger, #ef4444);
    text-decoration: underline;
}

/* Add Custom Dhikr Card */
.add-dhikr-card {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-dhikr-card:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.1) 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--glow);
}

.add-dhikr-content {
    text-align: center;
    padding: 20px;
}

.add-dhikr-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.add-dhikr-card:hover .add-dhikr-icon {
    opacity: 1;
    transform: scale(1.1);
}

.add-dhikr-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.add-dhikr-card:hover .add-dhikr-text {
    color: var(--accent);
}

/* Custom Dhikr Modal Styles */
.custom-dhikr-modal {
    max-width: 700px;
    max-height: 90vh;
}

.custom-dhikr-modal .modal-body {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group label .required {
    color: var(--danger, #ef4444);
}

.form-input {
    width: 100%;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.form-input.arabic-input {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    text-align: right;
    padding: 15px;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.8;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.color-input {
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

/* Custom Dhikr Actions - Edit button on left */
.custom-dhikr-actions {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    opacity: 1;
    z-index: 10;
    transition: opacity 0.3s ease;
}

/* Custom Dhikr Delete Action - Delete button on right */
.custom-dhikr-delete-action {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 1;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.custom-dhikr-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    z-index: 11;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.custom-dhikr-action-btn.edit-btn {
    background: var(--accent);
    color: white;
}

.custom-dhikr-action-btn.edit-btn:hover,
.custom-dhikr-action-btn.edit-btn:active {
    background: var(--accent-glow);
    transform: scale(1.1);
}

.custom-dhikr-action-btn.delete-btn {
    background: var(--danger, #ef4444);
    color: white;
}

.custom-dhikr-action-btn.delete-btn:hover,
.custom-dhikr-action-btn.delete-btn:active {
    background: #dc2626;
    transform: scale(1.1);
}

/* Responsive styles for custom dhikr modal */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .custom-dhikr-modal {
        width: 95%;
        max-width: none;
    }
    
    .form-input.arabic-input {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .custom-dhikr-modal .modal-body {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input {
        padding: 10px 12px;
    }
    
    .add-dhikr-card {
        min-height: 120px;
    }
    
    .add-dhikr-icon {
        font-size: 2.5rem;
    }
    
    .add-dhikr-text {
        font-size: 0.9rem;
    }
    
    /* Make action buttons smaller on mobile for better space usage */
    .custom-dhikr-action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.70rem;
    }
}