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

/* ===== Design Tokens ===== */
:root {
    --primary: #0f0f0f;
    --accent: #6b7280;
    --bg: #fafafa;
    --surface: #ffffff;
    --gray: #f3f4f6;
    --border: #e5e7eb;
    --holiday-bg: #fef2f2;
    --text: #111827;
    --text-muted: #9ca3af;
    --blue: #3b82f6;
    --blue-dark: #1d4ed8;
    --red: #ef4444;
    --green: #10b981;
    --yellow: #f59e0b;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary: #f9fafb;
    --accent: #9ca3af;
    --bg: #0a0a0a;
    --surface: #141414;
    --gray: #1c1c1c;
    --border: #2a2a2a;
    --holiday-bg: #1f1215;
    --text: #f3f4f6;
    --text-muted: #6b7280;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

section {
    margin-bottom: 5rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--primary);
}

h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--primary);
    margin-bottom: 1rem;
}

p {
    color: var(--accent);
    line-height: 1.8;
}

/* ===== Header ===== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.main-header .logo {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--primary);
    text-decoration: none;
}

.main-header nav ul {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.main-header a {
    text-decoration: none;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.main-header a:hover {
    color: var(--primary);
    background: var(--gray);
}

/* ===== Theme Toggle ===== */
#theme-toggle {
    background: var(--gray);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

#theme-toggle:hover {
    background: var(--border);
}

/* ===== Footer ===== */
.main-footer {
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 0.825rem;
    color: var(--text-muted);
}

.main-footer a {
    color: var(--accent);
    text-decoration: none;
}

.main-footer a:hover {
    color: var(--primary);
}

/* ===== Hero ===== */
#hero {
    padding: 3rem 0 1rem;
}

#hero h1 span {
    color: var(--blue);
}

/* ===== Dashboard Widgets ===== */
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.widget:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== Calendar Controls ===== */
#calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.state-selector label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.35rem;
}

select {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1.2em;
    padding-right: 2.2rem;
}

select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

button {
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    outline: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

button:hover {
    background: var(--gray);
}

button:active {
    transform: scale(0.97);
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.month-nav span {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    min-width: 130px;
    text-align: center;
    color: var(--primary);
}

/* ===== Calendar Grid ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.calendar-day-header {
    padding: 0.75rem 0.5rem;
    background: var(--gray);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.calendar-day-header:last-child {
    border-right: none;
}

.calendar-day {
    min-height: 90px;
    padding: 0.6rem 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.15s;
    position: relative;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.empty {
    background: var(--gray);
    opacity: 0.5;
}

.calendar-day:hover:not(.empty) {
    background: var(--gray);
}

.week-0,
.week-2,
.week-4 {
    background: var(--surface);
}

.week-1,
.week-3,
.week-5 {
    background: var(--surface);
}

.holiday-cell {
    background: var(--holiday-bg) !important;
}

.day-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
}

.holiday-name {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--red);
    margin-top: 4px;
    line-height: 1.3;
}

/* ===== Holiday List ===== */
#holiday-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

#holidays li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--accent);
}

#holidays li:last-child {
    border-bottom: none;
}

/* ===== Form ===== */
form {
    max-width: 480px;
}

.form-group {
    margin-bottom: 1rem;
}

input:not([type=range]),
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:not([type=range]):focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

button[type="submit"] {
    background: var(--primary);
    color: var(--bg);
    border: none;
    padding: 0.875rem 2rem;
    width: 100%;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    letter-spacing: -0.01em;
    transition: opacity 0.15s, transform 0.1s;
}

button[type="submit"]:hover {
    opacity: 0.85;
}

/* ===== Blog Cards ===== */
.blog-card {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.blog-card h3 a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
}

.blog-post h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.blog-post .intro {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.blog-post section {
    margin-bottom: 2.5rem;
}

.blog-post h2 {
    margin-bottom: 1rem;
}

.blog-post .faq {
    background: var(--gray);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}