* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #fbf8f1;
    color: #333333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2d6a4f;
    color: #f4f1de;
    text-align: center;
    padding: 3rem 1.5rem;
    border-bottom: 6px solid #e9c46a;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
}

.counter-container {
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    color: #2d6a4f;
    border-bottom: 2px solid #e9c46a;
    padding-bottom: 0.5rem;
    display: inline-block;
    width: 100%;
}

.dzikir-selector {
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: left;
}

.dzikir-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #1b4332;
}

.dzikir-selector select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1.05rem;
    background-color: #fbf8f1;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    /* Removes native dropdown arrow occasionally */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232d6a4f%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: right .7em top 50%, 0 0;
    background-size: .65em auto, 100%;
}

.dzikir-selector select:focus {
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.dzikir-text {
    width: 100%;
    background-color: #fbf8f1;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    border: 1px dashed #e9c46a;
    transition: all 0.3s ease;
}

.dzikir-text.hidden {
    display: none;
}

.dzikir-text .arabic {
    font-size: 2.5rem;
    color: #111111;
    margin-bottom: 0.5rem;
    font-family: serif;
    line-height: 1.5;
}

.dzikir-text .latin {
    font-size: 1.1rem;
    color: #555555;
    font-style: italic;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    margin-top: -0.5rem;
}

.progress-bar {
    height: 100%;
    background-color: #e9c46a;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-bar.complete {
    background-color: #2d6a4f;
}

.target-display {
    font-size: 1.2rem;
    color: #444444;
    background-color: #fbf8f1;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
}

.count-display {
    font-size: 6rem;
    font-weight: 700;
    color: #111111;
    line-height: 1;
    transition: transform 0.1s ease-out;
    margin: 1rem 0;
}

.count-display.pop {
    transform: scale(1.1);
}

.notification {
    background-color: #2d6a4f;
    color: #e9c46a;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
}

.notification.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.button-group {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.btn {
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    padding: 1rem;
}

.btn:active {
    transform: scale(0.95);
}

.btn-add {
    background-color: #e9c46a;
    color: #1b4332;
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 #d4a742;
}

.btn-add:active {
    box-shadow: 0 1px 0 #d4a742;
    transform: translateY(3px) scale(0.98);
}

.btn-add:hover {
    background-color: #f4a261;
}

.btn-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.btn-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

.btn-reset {
    background-color: #e8e8e8;
    color: #555555;
    flex: 1;
    box-shadow: 0 4px 0 #d0d0d0;
}

.btn-reset:active {
    box-shadow: 0 1px 0 #d0d0d0;
    transform: translateY(3px) scale(0.98);
}

.btn-reset:hover {
    background-color: #dcdcdc;
}

.stats-area {
    margin-top: 1.5rem;
    width: 100%;
    border-top: 2px dashed #e8e8e8;
    padding-top: 1.5rem;
    color: #666666;
    font-size: 1rem;
}

.stats-area strong {
    color: #2d6a4f;
    font-size: 1.2rem;
}

/* Modal CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(0) scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px) scale(0.95);
}

.modal-content h3 {
    color: #1b4332;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-content p {
    color: #555;
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-secondary {
    background-color: #e8e8e8;
    color: #333;
    flex: 1;
}

.btn-secondary:hover {
    background-color: #dcdcdc;
}

.btn-danger {
    background-color: #e63946;
    color: white;
    flex: 1;
}

.btn-danger:hover {
    background-color: #d62828;
}

footer {
    background-color: #1b4332;
    color: #f4f1de;
    text-align: center;
    padding: 2rem;
}

footer p {
    font-size: 1rem;
}

@media (max-width: 600px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .counter-container {
        padding: 1.5rem;
    }

    .count-display {
        font-size: 4.5rem;
    }

    .dzikir-text .arabic {
        font-size: 2rem;
    }
}