:root {
    --bg-color: #f7f8fc;
    --primary-color: #6a82fb;
    --primary-dark: #5269d1;
    --text-color: #343a40;
    --text-light: #888;
    --card-bg: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --border-radius: 20px;
}

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    padding-bottom: 80px; /* Space for bottom nav */
}

.main-content {
    padding: 1.5rem;
}

.view { display: none; }
.view.active { display: block; }

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    border-top-right-radius: var(--border-radius);
    border-top-left-radius: var(--border-radius);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.nav-item span {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* --- Timer View --- */
.timer-display-wrapper {
    text-align: center;
    padding: 3rem 0;
}

#timer-display {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary-color);
}

#timer-topic-display {
    color: var(--text-light);
    font-size: 1.2rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.session-card h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.session-form {
    display: grid;
    gap: 1rem;
}

input, select {
    width: 100%;
    padding: 1rem;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background-color: var(--bg-color);
    font-family: 'Vazirmatn', sans-serif;
}

.timer-controls {
    text-align: center;
    margin-top: 1rem;
}

.btn-float {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(106, 130, 251, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-float:hover { background: var(--primary-dark); }

#stop-btn { background: var(--danger-color); }

/* --- Stats View --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
}

.stat-card h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .chart-container {
    height: 150px;
}

/* --- Calendar View --- */
#calendar-wrapper {
    text-align: center;
}

#calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#calendar-header button { background: none; border: none; cursor: pointer; }

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    padding: 0.8rem 0.5rem;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.calendar-day.has-event {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}

#calendar-events { margin-top: 1.5rem; }

/* --- Modals --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.active { display: flex; }
.modal-content { width: 90%; max-width: 400px; }
.modal-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.5rem; border: none; border-radius: 10px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: all 0.3s ease; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); }
