:root {
    /* رنگ‌های ثابت برند برنامه */
    --primary: #10b981;
    --primary-dark: #059669;
    
    /* متغیرهای دینامیک که توسط ایتا پر می‌شوند */
    --bg-gradient: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #064e3b;
    --text-secondary: #047857;
    --shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.1);
    --card-bg: #f0fdf4; /* رنگ پیش‌فرض کارت‌ها */
    --bg-color: #ffffff;
    --danger: #ef4444;
}

[data-theme="dark"] {
    /* این بخش فقط برای حالت دستی است، در ایتا ما با JS رنگ‌ها را ست می‌کنیم */
    --bg-gradient: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    --glass-bg: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ecfdf5;
    --text-secondary: #6ee7b7;
    --shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5);
    --card-bg: #1f2937;
    --bg-color: #000000;
}

/* بقیه کدهای CSS شما بدون تغییر باقی می‌مانند */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    --glass-bg: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ecfdf5;
    --text-secondary: #6ee7b7;
    --shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5);
    --card-bg: #1f2937;
}

@font-face {
    font-family: vazir;
    src: url(Vazir.ttf);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'vazir', Tahoma, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100dvh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

.app-container {
    width: 100%;
    max-width: 450px;
    height: 100dvh;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow);
}

@media (min-width: 451px) {
    .app-container {
        height: 95dvh;
        border-radius: 20px;
        margin: 10px;
    }
}

.header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
}

.sun { display: none; }
[data-theme="dark"] .sun { display: block; }
[data-theme="dark"] .moon { display: none; }

.view {
    display: none;
    animation: fadeIn 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.intro-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    justify-content: center;
    overflow-y: auto;
    padding-bottom: 30px;
}

.intro-content h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.intro-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

select, input, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    resize: vertical;
    min-height: 60px;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
    margin-top: 5px;
    flex-shrink: 0;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.02);
}

.resume-card-content {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.resume-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.resume-info h3 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.btn-text {
    background: #064e3b;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 8px;
}

.tabs {
    display: flex;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    padding: 3px;
    margin: 0 15px 15px;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content {
    flex: 1;
    padding: 0 15px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.daily-message-card {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border-right: 3px solid var(--primary);
    flex-shrink: 0;
}

.msg-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.msg-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.msg-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-main);
}

.current-session-info {
    background: rgba(16, 185, 129, 0.1);
    padding: 8px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.info-item .value {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.btn-edit-settings {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-settings:hover {
    background: var(--primary);
    color: white;
}

.counter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
    flex-shrink: 0;
}

.circle-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: relative;
    margin-bottom: 20px;
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle-container:active {
    transform: scale(0.95);
}

.circle-container.pulse {
    animation: pulse-anim 0.3s ease-out;
}

@keyframes pulse-anim {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.count-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.count-number {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.zekr-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.progress-container {
    width: 100%;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.progress-track {
    height: 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-left: 5px;
}

.history-item {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 3px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.history-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.history-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-left: 5px;
}

.challenge-card {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.challenge-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.challenge-card.completed {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.challenge-info {
    flex: 1;
}

.challenge-title {
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.challenge-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.challenge-icon {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #9ca3af;
    margin-right: 8px;
}

.challenge-card.completed .challenge-icon {
    background: var(--primary);
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    max-width: 85%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-close {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
}

.btn-new-intention {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-new-intention:hover {
    background: rgba(16, 185, 129, 0.1);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 260px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 15px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-overlay.open .menu-content {
    transform: translateX(0);
}

.close-menu-btn {
    align-self: flex-end;
    margin-bottom: 5px;
}

.menu-section h3 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 4px;
}

.menu-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(16, 185, 129, 0.15);
}

.menu-icon {
    font-size: 1.3rem;
    width: 25px;
    height: 25px;
}

.menu-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.menu-footer {
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* استایل‌های جدید برای لیست کارت‌های ناتمام */
.resume-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    margin-bottom: 10px;
}

.minimal-session-card {
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.05);
    border-right: 3px solid var(--primary);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.minimal-session-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-right-color: var(--primary-dark);
}

.minimal-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    margin-left: 8px;
}

.minimal-card-zekr {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.minimal-card-intention {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.minimal-card-count {
    text-align: left;
    min-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.minimal-card-number {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.minimal-card-total {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}