:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --danger: #ef4444;
    --success: #22c55e;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* Background Shapes for Glassmorphism depth */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #10b981;
    top: 40%;
    left: 40%;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

/* Glass Basics */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
}

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
}

[data-theme="dark"] .glass-panel-inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Container */
.main-container {
    width: 90%;
    max-width: 480px;
    /* Mobile-first friendly width */
    height: 90vh;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    position: relative;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 10px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.dashboard,
.controls-area,
.reminders-list,
.history-section {
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    color: var(--text-main);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.icon-btn span {
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard */
.dashboard {
    margin-bottom: 24px;
}

.progress-card {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 326.7;
    /* 2 * PI * 52 */
    stroke-dashoffset: 326.7;
    stroke-linecap: round;
}

.progress-stats {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
}

.label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-text h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.stats-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Controls */
.controls-area {
    margin-bottom: 20px;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: transform 0.1s, background 0.2s;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Reminders List */
.reminders-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    min-height: 200px;
}

.reminder-card {
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .reminder-card {
    background: rgba(255, 255, 255, 0.05);
}

.reminder-card:hover {
    transform: scale(1.02);
}

.reminder-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.reminder-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-actions {
    display: flex;
    gap: 8px;
}

.check-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: transparent;
    cursor: pointer;
    color: transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-btn:hover {
    border-color: var(--success);
    color: var(--success);
}

.reminder-card.completed .check-btn {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.reminder-card.completed .reminder-info {
    opacity: 0.5;
    text-decoration: line-through;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

/* History */
.history-section {
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1.1rem;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.history-list {
    list-style: none;
    /* max-height: 150px;  Removed to allow full expansion */
    /* overflow-y: auto; */
    padding-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

[data-theme="dark"] .history-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item span {
    color: var(--text-muted);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 24px;
    transform: translateY(0);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    outline: none;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    justify-content: space-between;
}

.checkbox-group label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    cursor: pointer;
}

.checkbox-group input {
    margin-bottom: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.secondary-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--text-muted);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-main);
}

/* Responsive */
@media (max-width: 600px) {
    .main-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
}