/* CSS Variables for Theming */
:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --text-secondary: #555;
    --text-heading: #2c3e50;
    --text-subheading: #34495e;
    --border-color: #ecf0f1;
    --border-heading: #2c3e50;
    --link-color: #2980b9;
    --link-hover: #3498db;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Dark mode colors (Reddit-inspired) */
[data-theme="dark"] {
    --bg-primary: #0b0b0b;
    --bg-secondary: #1a1a1b;
    --text-primary: #d7dadc;
    --text-secondary: #818384;
    --text-heading: #ffffff;
    --text-subheading: #d7dadc;
    --border-color: #343536;
    --border-heading: #343536;
    --link-color: #d7dadc;
    --link-hover: #ffffff;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Auto dark mode based on system preference (Reddit-inspired) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0b0b0b;
        --bg-secondary: #1a1a1b;
        --text-primary: #d7dadc;
        --text-secondary: #818384;
        --text-heading: #ffffff;
        --text-subheading: #d7dadc;
        --border-color: #343536;
        --border-heading: #343536;
        --link-color: #d7dadc;
        --link-hover: #ffffff;
        --shadow: rgba(0, 0, 0, 0.5);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
    z-index: 1000;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow);
    background: var(--bg-primary);
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    padding: 40px 50px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Header */
h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--border-heading);
    padding-bottom: 15px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

h1 + p {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-subheading);
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

/* Contact Info */
h1 + p,
h1 + p + p,
h1 + p + p + p,
h1 + p + p + p + p {
    text-align: center;
    margin: 5px 0;
    color: var(--text-secondary);
}

h1 + p + p + p + p + hr {
    margin: 30px 0;
    border: none;
    border-top: 2px solid var(--border-color);
}

/* Headings */
h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-heading);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 35px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

h3 {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-heading);
    margin-top: 25px;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

h4 {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-subheading);
    margin-top: 15px;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

/* Paragraphs */
p {
    margin-bottom: 12px;
    line-height: 1.7;
}

p strong {
    color: var(--text-heading);
    transition: color 0.3s ease;
}

/* Lists */
ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Images */
img {
    transition: opacity 0.3s ease;
}

/* Horizontal Rules */
hr {
    margin: 30px 0;
    border: none;
    border-top: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.3em;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.2em;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 20px;
        max-width: 100%;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    .theme-toggle {
        display: none;
    }
}
