/* --- Resetimi Bazë dhe Përgatitja e Fondit --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* --- Variablat e Temave --- */
:root {
    --text-light: #ffffff;
    --text-dark: #1f2937;
    --shadow-light: rgba(255, 255, 255, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --accent-color-forest: #34d399;
    --accent-color-desert: #f59e0b;
    --accent-color-night: #818cf8;
}

/* --- Stili i Trupit të Faqes (Body) --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 0 15px;
    transition: background 0.8s ease-in-out;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text-light);
}

/* --- Temat Vizuale (Sfondet) --- */
.theme-forest {
    background: linear-gradient(170deg, #0d4e51, #1b7c80, #3aa8ad, #1b7c80, #0d4e51);
    background-size: 100% 150%;
}
.theme-desert {
    background: linear-gradient(170deg, #4a2e2a, #c26742, #e59a58, #c26742, #4a2e2a);
    background-size: 100% 150%;
}
.theme-night  {
    background: linear-gradient(170deg, #020111, #19163a, #3c327a, #19163a, #020111);
    background-size: 100% 150%;
}

/* --- Kontejneri Kryesor i Aplikacionit --- */
.container {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100dvh; 
    padding: 40px 0;
    gap: 20px;
}


/* --- Kontrollet e Sipërme --- */
.top-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn.push-right {
    margin-right: auto; 
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    text-decoration: none;
}
.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}
.control-btn.active i { 
    color: var(--accent-color-forest); 
}

/* --- Numëruesi me Rreth Progreset SVG --- */
.progress-counter {
    position: relative;
    width: 300px;
    height: 300px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease; /* Shtuar për butësi */
}

/* SHTESA E RE: Animacioni i pulsimit për rrethin */
.progress-counter.pulsing {
    animation: pulse-effect 0.4s ease-in-out;
}

@keyframes pulse-effect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}


.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-track {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 5;
}

.progress-ring-indicator {
    fill: transparent;
    stroke: var(--text-light);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease-out, stroke 0.8s ease;
}
.theme-forest .progress-ring-indicator { stroke: var(--accent-color-forest); }
.theme-desert .progress-ring-indicator { stroke: var(--accent-color-desert); }
.theme-night .progress-ring-indicator { stroke: var(--accent-color-night); }


.counter-display-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.counter-display {
    font-size: 7rem;
    font-weight: 300;
}
.counter-display.animating {
    animation: slideUpIn 0.4s ease-out forwards;
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(30%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Kontrollet e Poshtme --- */
.bottom-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loop-control {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    padding: 5px;
}

.loop-counter, .target-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: 45px;
    transition: background-color 0.3s ease;
}

.loop-counter {
    flex-direction: column;
    padding: 0 20px;
    font-weight: 600;
}
.loop-label { font-size: 0.7rem; opacity: 0.8; }
#loopCount { font-size: 1.2rem; }

.target-btn {
    background: rgba(0, 0, 0, 0.2);
    padding: 0 20px;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light); 
}
.target-btn:hover { background: rgba(0, 0, 0, 0.3); }

.dhikr-dropdown {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    color: var(--text-light);
    cursor: pointer;
    appearance: none;
    -webkit-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%23ffffff%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.4-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 0.7rem;
    transition: background-color 0.3s ease;
}
.dhikr-dropdown:hover { background: rgba(255, 255, 255, 0.2); }
.dhikr-dropdown option { background: var(--text-dark); color: var(--text-light); }
.dhikr-dropdown .add-new-option { font-style: italic; color: var(--accent-color-forest); }


/* --- Stili i Dritareve Modale --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 15px;
}
.modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 350px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-backdrop.visible .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Stilizimi i ri për butonat brenda modaleve */
.target-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.target-option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.target-option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Stili për butonin aktiv sipas temës */
.theme-forest .target-option-btn.active {
    background-color: var(--accent-color-forest);
    color: var(--text-dark);
    border-color: var(--accent-color-forest);
}
.theme-desert .target-option-btn.active {
    background-color: var(--accent-color-desert);
    color: var(--text-dark);
    border-color: var(--accent-color-desert);
}
.theme-night .target-option-btn.active {
    background-color: var(--accent-color-night);
    color: var(--text-light);
    border-color: var(--accent-color-night);
}

.modal-close-btn, .modal-action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.modal-close-btn {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
}
.modal-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Stilizimi për modalin e shtimit të dhikrit */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-action-btn {
    background-color: var(--accent-color-forest);
    color: var(--text-dark);
}
.modal-action-btn:hover {
    opacity: 0.9;
}

#newDhikrInput {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    margin-bottom: 10px;
}
#newDhikrInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}


/* --- Stili për Përmbajtjen SEO --- */
.main-content {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seo-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    padding: 50px 0;
}

.page-header, .info-section {
    text-align: center;
    width: 95%;
    max-width: 550px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

.info-section h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.info-section h3 {
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-section p {
    line-height: 1.7;
    opacity: 0.9;
    text-align: left;
}

.info-section strong {
    font-weight: 600;
}

.info-section ol {
    list-style-position: inside;
    text-align: left;
    margin-top: 15px;
    padding-left: 10px;
}

.info-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .page-header h1 { font-size: 1.5rem; }
    .info-section h2 { font-size: 1.4rem; }
    .counter-display { font-size: 6rem; }
    .progress-counter { width: 280px; height: 280px; }
}