:root {
    --bg-color: #0d0d0d;
    --panel-bg: #141414;
    --accent-color: #ff3333;
    --text-main: #f5f5f5;
    --text-muted: #888888;
    --border-color: #2a2a2a;
    --success-color: #4CAF50;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    padding: 10px;
    cursor: pointer;
}

.date-display {
    text-align: center;
    display: flex;
    flex-direction: column;
}

#day-number {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-color);
}

#month-name {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    padding-bottom: 20px;
}

.view {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- View: Habits (Today) --- */
.progress-ring-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 20px 0 30px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.5s ease-out;
}

.progress-ring-text {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
}

.add-habit-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#new-habit-input {
    flex-grow: 1;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-body);
}

#new-habit-input:focus {
    outline: 1px solid var(--accent-color);
}

#add-habit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    width: 50px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-habits-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-habit-item {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, background-color 0.2s;
}

.mobile-habit-item.checked {
    border-color: var(--accent-color);
    background-color: rgba(209, 26, 42, 0.1);
}

.habit-name-col {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mobile-habit-name {
    font-size: 16px;
    font-weight: 600;
}

.habit-streak {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Custom Large Checkbox */
.mobile-checkbox-container {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-habit-item.checked .mobile-checkbox-container {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.mobile-checkbox-container::after {
    content: '✓';
    color: white;
    font-weight: 900;
    font-size: 18px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.mobile-habit-item.checked .mobile-checkbox-container::after {
    opacity: 1;
    transform: scale(1);
}

/* --- View: Progress --- */
.view-title {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 20px;
}

.stats-card {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    flex: 1;
    background-color: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-color);
    margin-top: 10px;
}

.chart-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.card-title {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.mobile-chart {
    height: 150px;
    width: 100%;
    position: relative;
}

/* --- View: Settings --- */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-item {
    display: block;
    width: 100%;
    padding: 20px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.settings-item.danger {
    color: #ff4d4d;
    border-color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
}

/* --- Bottom Navigation --- */
.bottom-nav {
    display: flex;
    background-color: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    height: 70px;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item .icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.nav-item .label {
    font-size: 12px;
    font-weight: 600;
}

.nav-item.active {
    color: var(--accent-color);
}
