:root {
    /* Dark Tech Theme */
    --bg-color: #020617;      /* Slate 950 */
    --bg-accent: #0f172a;     /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.4); /* Translucent Slate 800 */
    --header-bg: rgba(2, 6, 23, 0.7); /* Translucent Slate 950 */
    
    /* Neon Accents */
    --primary-color: #06b6d4; /* Cyan 500 */
    --primary-light: #22d3ee; /* Cyan 400 */
    --secondary-color: #6366f1; /* Indigo 500 */
    --accent-glow: rgba(6, 182, 212, 0.5);
    
    /* Text */
    --text-main: #f8fafc;     /* Slate 50 */
    --text-muted: #94a3b8;    /* Slate 400 */
    
    /* Borders & Misc */
    --border-color: rgba(148, 163, 184, 0.1);
    --radius: 16px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    
    /* Calendar specific colors - Neon versions */
    --success-color: #10b981; /* Emerald 500 */
    --success-glow: rgba(16, 185, 129, 0.4);
    --danger-color: #ef4444;  /* Red 500 */
    --danger-glow: rgba(239, 68, 68, 0.4);
    --neutral-color: #334155; /* Slate 700 */
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    /* Cyberpunk gradient background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Glassmorphism */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.logo svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-light);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--primary-color);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Buttons - Neon Tech Style */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(99, 102, 241, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    text-align: left;
    position: relative;
    z-index: 2;
}

.hero-content {
    flex: 1;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-content p {
    margin: 0 0 40px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    opacity: 0.2;
    filter: blur(40px);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.15; }
    100% { transform: scale(1.05); opacity: 0.25; }
}

.hero-image img {
    position: relative;
    max-width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    max-height: 400px;
    object-fit: cover;
    z-index: 1;
    border: 1px solid var(--border-color);
}

/* Features Grid */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--text-main), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

/* Card Link Wrapper */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link .card {
    height: 100%; /* Ensure cards are same height */
    cursor: pointer;
}

.card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.card-link:hover .card {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px -10px rgba(6, 182, 212, 0.2);
}

.card h3 {
    margin-bottom: 16px;
    color: var(--primary-light);
    font-size: 1.5rem;
    font-weight: 600;
}

.card-link:hover .card h3 {
    text-shadow: 0 0 10px var(--accent-glow);
}

.card p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Footer */
footer {
    background-color: rgba(2, 6, 23, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 60px 0;
    margin-top: 80px;
    text-align: center;
    color: var(--text-muted);
}

/* Check-in Calendar Styles */
.checkin-section {
    padding: 60px 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.calendar-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.stats-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.stat-card .unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.stat-card.success .value { color: var(--success-color); text-shadow: 0 0 15px var(--success-glow); }
.stat-card.danger .value { color: var(--danger-color); text-shadow: 0 0 15px var(--danger-glow); }
.stat-card.streak .value { color: var(--primary-light); text-shadow: 0 0 15px var(--accent-glow); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 0;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-muted);
}

.day-cell:hover:not(.empty) {
    background-color: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
    z-index: 2;
}

.day-cell.empty {
    background-color: transparent;
    cursor: default;
}

.day-cell.success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 15px var(--success-glow);
}

.day-cell.danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: 0 0 15px var(--danger-glow);
}

.day-cell.today {
    border: 2px solid var(--primary-color);
    box-shadow: inset 0 0 15px var(--accent-glow);
    color: var(--text-main);
}

.legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 32px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.dot.success { background-color: var(--success-color); color: var(--success-glow); }
.dot.danger { background-color: var(--danger-color); color: var(--danger-glow); }
.dot.neutral { background-color: var(--neutral-color); border: 1px solid var(--text-muted); box-shadow: none; }

/* Notes Page Styles */
.notes-section {
    padding: 60px 0;
}

.note-editor {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.note-input {
    width: 100%;
    min-height: 180px;
    padding: 20px;
    background-color: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 24px;
    font-size: 1.05rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.note-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background-color: rgba(2, 6, 23, 0.8);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.note-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.note-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.note-date {
    font-size: 0.9rem;
    color: var(--primary-light);
    margin-bottom: 12px;
    font-family: monospace;
    opacity: 0.8;
}

.note-content {
    white-space: pre-wrap;
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1.05rem;
}

.delete-note {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.note-card:hover .delete-note {
    opacity: 1;
}

.delete-note:hover {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 0 10px var(--danger-glow);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.modal {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    animation: popIn 0.3s forwards;
    position: relative;
}

@keyframes popIn {
    to { transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.status-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.status-option input {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    color: var(--text-muted);
}

.option-card .icon {
    font-size: 1.5rem;
}

/* Checked States */
.status-option input:checked + .option-card.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 15px var(--success-glow);
}

.status-option input:checked + .option-card.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 15px var(--danger-glow);
}

.form-group {
    margin-bottom: 24px;
    text-align: center;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.count-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.count-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

#relapseCountInput {
    width: 60px;
    padding: 8px;
    text-align: center;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
}

#relapseCountInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* Notes Enhancements */
.editor-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-start;
}

.tag-select {
    background: rgba(2, 6, 23, 0.6);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.notes-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
    background: rgba(6, 182, 212, 0.05);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.note-tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Tag specific colors */
.tag-Insight { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }
.tag-Knowledge { background: rgba(6, 182, 212, 0.1); color: #22d3ee; border-color: rgba(6, 182, 212, 0.2); }
.tag-Reflection { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.tag-Motto { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border-color: rgba(245, 158, 11, 0.2); }
.tag-Other { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border-color: rgba(148, 163, 184, 0.2); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 40px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-links {
        display: none; /* In a real project, we'd add a hamburger menu */
    }
    
    .hero-image::before {
        display: none;
    }
    
    .calendar-grid {
        gap: 6px;
        padding: 16px;
    }
    
    .day-cell {
        border-radius: 8px;
        font-size: 0.9rem;
    }
}
