/* Import Google Sans font */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  /* hsl (fallback color) */
  --bg-dark: hsl(204 54% 1%);
  --bg: hsl(201 34% 4%);
  --bg-light: hsl(200 19% 8%);
  --text: hsl(201 85% 94%);
  --text-muted: hsl(200 14% 69%);
  --highlight: hsl(200 10% 39%);
  --border: hsl(200 14% 28%);
  --border-muted: hsl(200 21% 18%);
  --primary: hsl(199 70% 65%);
  --secondary: hsl(22 68% 68%);
  --danger: hsl(9 26% 64%);
  --warning: hsl(52 19% 57%);
  --success: hsl(146 17% 59%);
  --info: hsl(217 28% 65%);
  /* oklch */
  --bg-dark: oklch(0.1 0.01 230);
  --bg: oklch(0.15 0.01 230);
  --bg-light: oklch(0.2 0.01 230);
  --text: oklch(0.96 0.02 230);
  --text-muted: oklch(0.76 0.02 230);
  --highlight: oklch(0.5 0.02 230);
  --border: oklch(0.4 0.02 230);
  --border-muted: oklch(0.3 0.02 230);
  --primary: oklch(0.76 0.1 230);
  --secondary: oklch(0.76 0.1 50);
  --danger: oklch(0.7 0.05 30);
  --warning: oklch(0.7 0.05 100);
  --success: oklch(0.7 0.05 160);
  --info: oklch(0.7 0.05 260);

  /* Shadow */
    --elevation: 2;
    --epx: calc(var(--elevation) * 1px);
    --shadow1: 0 0 1px rgba(0, 0, 0, .1);
    --shadow2: 0 1px 2px rgba(0, 0, 0, .08);
    --offset-y: calc(var(--epx) + 1px);
    --blur: calc(var(--epx) * 2);
    --spread: calc(var(--epx) * .3);
    --shadow3:
        0 var(--offset-y)
        var(--blur)
        var(--spread)
        rgba(0, 0, 0, 0.2);
    --elevation2-shadow:
        var(--shadow1),
        var(--shadow2),
        var(--shadow3);

    --elevation4: 4;
    --epx4: calc(var(--elevation4) * 1px);
    --offset-y4: calc(var(--epx4) + 1px);
    --blur4: calc(var(--epx4) * 2);
    --spread4: calc(var(--epx4) * .3);
    --shadow4:
        0 var(--offset-y4)
        var(--blur4)
        var(--spread4)
        rgba(0, 0, 0, 0.2);
    --elevation4-shadow:
        var(--shadow1),
        var(--shadow2),
        var(--shadow4);
}
body.light {
  /* hsl (fallback color) */
  --bg-dark: hsl(201 22% 89%);
  --bg: hsl(201 44% 95%);
  --bg-light: hsl(201 100% 100%);
  --text: hsl(202 68% 4%);
  --text-muted: hsl(200 14% 28%);
  --highlight: hsl(201 100% 100%);
  --border: hsl(200 8% 50%);
  --border-muted: hsl(200 11% 62%);
  --primary: hsl(194 100% 16%);
  --secondary: hsl(25 87% 24%);
  --danger: hsl(9 21% 41%);
  --warning: hsl(52 23% 34%);
  --success: hsl(147 19% 36%);
  --info: hsl(217 22% 41%);
  /* oklch */
  --bg-dark: oklch(0.92 0.01 230);
  --bg: oklch(0.96 0.01 230);
  --bg-light: oklch(1 0.01 230);
  --text: oklch(0.15 0.02 230);
  --text-muted: oklch(0.4 0.02 230);
  --highlight: oklch(1 0.02 230);
  --border: oklch(0.6 0.02 230);
  --border-muted: oklch(0.7 0.02 230);
  --primary: oklch(0.4 0.1 230);
  --secondary: oklch(0.4 0.1 50);
  --danger: oklch(0.5 0.05 30);
  --warning: oklch(0.5 0.05 100);
  --success: oklch(0.5 0.05 160);
  --info: oklch(0.5 0.05 260);
}

body {
    font-family: 'Google Sans', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-dark) 100%);
    min-height: 100vh;
}

.container {
    max-width: 70vw;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
}

.header {
    background: var(--bg-light);
    padding: 3rem 2rem;
    margin-bottom: 1rem;
    border-radius: 0 0 3rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.app-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    box-shadow: var(--elevation2-shadow);
}

.logo-text {
    text-align: left;
}

.logo h1 {
    color: var(--primary);
    font-size: 32pt;
    font-weight: 500;
    line-height: 40pt;
    margin: 0;
}

.logo p {
    color: var(--text-muted);
    font-size: 16pt;
    font-weight: 500;
    line-height: 24pt;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border: none;
    background: var(--bg-light);
    color: var(--text);
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--elevation2-shadow);
    transition: all 0.3s ease-in-out;
    z-index: 1001;
}

.theme-toggle:hover {
    box-shadow: var(--elevation4-shadow);
}

.date {
    background: var(--bg-light);
    border-radius: 3rem;
    margin-bottom: 1rem;
    padding: 1.5rem 2rem;
}

.date-content {
    display: flex;
    gap: 5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.date-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
}

.main-content {
    flex: 1;
    background: var(--bg-light);
    border-radius: 3rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.markdown-content {
    padding: 2rem;
}

.loading {
    text-align: center;
    color: var(--text);
    font-size: 1.1rem;
    padding: 2rem;
}

.markdown-content h1 {
    color: var(--primary);
    font-size: 28pt;
    font-weight: 500;
    line-height: 36pt;
    position: relative;
}

.markdown-content h1:first-child {
    text-align: center;
}

.markdown-content h2 {
    color: var(--primary);
    font-size: 22pt;
    font-weight: 500;
    line-height: 28pt;
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-muted);
    position: relative;
}

.markdown-content h3 {
    color: var(--primary);
    font-size: 16pt;
    font-weight: 500;
    line-height: 24pt;
    margin-bottom: 0.5rem;
    position: relative;
}

.markdown-content h4 {
    color: var(--primary);
    font-size: 14pt;
    font-weight: 500;
    line-height: 20pt;
    margin-bottom: 0.5rem;
    position: relative;
}

.markdown-content p {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 12pt;
    font-weight: 400;
    line-height: 16pt;
    text-align: justify;
    hyphens: auto;
}

.markdown-content strong {
    color: var(--secondary);
    font-size: 12pt;
    font-weight: 500;
    line-height: 16pt;
}

.markdown-content ul, .markdown-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-content li {
    margin-top: 0.5rem;
    color: var(--text);
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
    font-size: 12pt;
    font-weight: 500;
    line-height: 16pt;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.markdown-content a:hover {
    color: var(--secondary);
}

.footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 11pt;
    font-weight: 500;
    line-height: 16pt;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease-in-out;
}

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

/* Floating Action Button for scroll to top */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transform: scale(0.8);
    box-shadow: var(--elevation2-shadow);
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

.fab.visible {
    opacity: 1;
    transform: scale(1);
}

.fab:hover {
    box-shadow: var(--elevation4-shadow);
    transform: scale(1.05);
}

/* Subtle reveal animation */
@keyframes subtleReveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: subtleReveal 1s ease-in-out forwards;
}

/* Responsive Design */

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
    .container {
        max-width: 85vw;
    }
}

/* Tablets portrait and small screens */
@media (max-width: 768px) {
    .container {
        max-width: 90vw;
    }

    .header {
        padding: 2rem 1.5rem;
        border-radius: 0 0 2rem 2rem;
    }

    .logo {
        gap: 1rem;
    }

    .app-icon {
        width: 3.5rem;
        height: 3.5rem;
    }

    .logo h1 {
        font-size: 20pt;
        line-height: 28pt;
    }

    .logo p {
        font-size: 12pt;
        line-height: 18pt;
    }

    .date {
        border-radius: 2rem;
        padding: 1.25rem 1.5rem;
    }

    .date-content {
        gap: 3rem;
    }

    .main-content {
        border-radius: 2rem;
    }

    .markdown-content {
        padding: 1.5rem;
    }

    .markdown-content h1 {
        font-size: 20pt;
        line-height: 28pt;
    }

    .markdown-content h2 {
        font-size: 16pt;
        line-height: 22pt;
        margin: 2rem 0 1rem 0;
    }

    .markdown-content h3 {
        font-size: 13pt;
        line-height: 18pt;
    }

    .markdown-content h4 {
        font-size: 12pt;
        line-height: 17pt;
    }

    .markdown-content p,
    .markdown-content a,
    .markdown-content strong {
        font-size: 11pt;
        line-height: 15pt;
    }

    .theme-toggle,
    .fab {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 18px;
    }

    .theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
    }

    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        max-width: 95vw;
    }

    .header {
        padding: 1.5rem 1rem;
        border-radius: 0 0 1.5rem 1.5rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.75rem;
    }

    .logo-text {
        text-align: center;
    }

    .app-icon {
        width: 3rem;
        height: 3rem;
    }

    .logo h1 {
        font-size: 18pt;
        line-height: 24pt;
    }

    .logo p {
        font-size: 11pt;
        line-height: 16pt;
    }

    .date {
        border-radius: 1.5rem;
        padding: 1rem 1rem;
    }

    .date-content {
        gap: 2rem;
        flex-direction: column;
    }

    .date-label {
        font-size: 9px;
    }

    .date-value {
        font-size: 13px;
    }

    .main-content {
        border-radius: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .markdown-content {
        padding: 1.25rem;
    }

    .markdown-content h1 {
        font-size: 18pt;
        line-height: 24pt;
    }

    .markdown-content h2 {
        font-size: 14pt;
        line-height: 20pt;
        margin: 1.5rem 0 1rem 0;
    }

    .markdown-content h3 {
        font-size: 12pt;
        line-height: 16pt;
    }

    .markdown-content h4 {
        font-size: 11pt;
        line-height: 16pt;
    }

    .markdown-content p,
    .markdown-content a,
    .markdown-content strong {
        font-size: 10pt;
        line-height: 14pt;
    }

    .markdown-content ul, .markdown-content ol {
        margin-left: 1rem;
    }

    .footer {
        font-size: 9pt;
        line-height: 13pt;
    }

    .theme-toggle,
    .fab {
        width: 3rem;
        height: 3rem;
        font-size: 16px;
        border-radius: 15px;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }

    .fab {
        bottom: 1rem;
        right: 1rem;
    }
}