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

:root {
    /* Premium White Palette */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-secondary: #ffffff;
    /* White */
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    /* Slate 200 */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

    /* Accents */
    --primary: #2563eb;
    /* Blue 600 */
    --primary-hover: #1d4ed8;
    /* Blue 700 */
    --primary-subtle: #eff6ff;
    /* Blue 50 */

    --accent: #10b981;
    /* Emerald 500 */

    /* Text */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    /* Timeline Colors */
    --day-work-bg: #f1f5f9;
    /* Slate 100 */
    --day-work-text: #475569;
    /* Slate 600 */
    --day-weekend-bg: #e2e8f0;
    /* Slate 200 */
    --day-weekend-text: #94a3b8;
    /* Slate 400 */
    --day-holiday-bg: #fee2e2;
    /* Red 100 */
    --day-holiday-text: #dc2626;
    /* Red 600 */
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 0;
    color: var(--text-main);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.brand span {
    color: var(--text-main);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Main Content Spacing */
main {
    padding: 3rem 0;
}

h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* Cards */
.card-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

/* Calculator Form */
.toggle-mode {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.3rem;
    border-radius: 99px;
    width: fit-content;
    margin: 0 auto 2.5rem auto;
    border: 1px solid var(--card-border);
}

.toggle-mode label {
    cursor: pointer;
    padding: 0.6rem 1.5rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-muted);
}

.toggle-mode input {
    display: none;
}

.toggle-mode label:has(input:checked) {
    background: var(--bg-secondary);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="date"],
input[type="number"] {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 1rem 3rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    font-family: 'Outfit', sans-serif;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results */
.result-card {
    text-align: center;
    background: linear-gradient(to bottom, #fff, #f8fafc);
}

.result-card h2 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.big-result {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.sticky-tools {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-tool {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

/* Timeline */
.timeline-container h3 {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.timeline-scroll {
    overflow-x: auto;
    padding: 1rem 0 2rem 0;
}

.timeline-track {
    display: flex;
    gap: 4px;
    padding: 0 2rem;
    min-width: max-content;
}

.day-block {
    flex: 0 0 50px;
    height: 80px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    position: relative;
    border: 1px solid transparent;
}

.day-block.workday {
    background: var(--day-work-bg);
    color: var(--day-work-text);
}

.day-block.weekend {
    background: var(--day-weekend-bg);
    color: var(--day-weekend-text);
}

.day-block.holiday {
    background: var(--day-holiday-bg);
    color: var(--day-holiday-text);
    font-weight: 600;
}

.day-block.start,
.day-block.end {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.day-date {
    font-weight: 700;
    font-size: 1.1rem;
}

.day-name {
    opacity: 0.8;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.legend-item::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Content Section (SEO) */
.content-section {
    max-width: 800px;
    margin: 4rem auto 0 auto;
}

.content-section h2 {
    margin-top: 2rem;
    font-size: 1.8rem;
}

.content-section p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.content-section ul {
    color: var(--text-muted);
    font-size: 1.05rem;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Popular Links Grid */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.popular-link {
    display: block;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-align: center;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
}

.popular-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    text-decoration: none;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--card-border);
    margin-top: 5rem;
    padding: 4rem 0;
    background: var(--bg-main);
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
}

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

/* Mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .input-group {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-panel {
        padding: 1.5rem;
    }
}