@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-base: #0f0f23;
    --indigo: #6366f1;
    --purple: #8b5cf6;
    --amber: #f59e0b;
    --teal: #14b8a6;
    --rose: #f43f5e;

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 40px;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 50%, #1e3a5f 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal), var(--indigo), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 16px;
}

.date-display {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.main-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.add-habit-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.add-habit-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.add-habit-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
}

#habitInput {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

#habitInput:focus {
    outline: none;
    border-color: var(--teal);
}

#habitIcon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--indigo));
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.5);
}

.habits-container {
    display: grid;
    gap: 16px;
}

.habit-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.habit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.habit-card.completed {
    border-color: var(--teal);
    background: rgba(20, 184, 166, 0.1);
}

.habit-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.habit-info {
    flex: 1;
}

.habit-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.habit-streak {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.habit-streak.active {
    color: var(--amber);
}

.check-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-btn:hover {
    border-color: var(--teal);
    background: rgba(20, 184, 166, 0.1);
}

.check-btn.checked {
    border-color: var(--teal);
    background: var(--teal);
    color: white;
}

.delete-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: var(--rose);
    color: white;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Space Mono', monospace;
    background: linear-gradient(135deg, var(--teal), var(--indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-section {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
}

.chart-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#activityChart {
    width: 100%;
    height: 200px;
}

@media (max-width: 768px) {
    .add-habit-form {
        grid-template-columns: 1fr;
    }

    .habit-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .check-btn,
    .delete-btn {
        grid-column: 2;
    }
}