:root {
    /* Light mode colors */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dddddd;
    --border-light: #eeeeee;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --accent-gold: #F8B741;
    --accent-gold-hover: #e67e22;
    --accent-green: #5CC279;
    --accent-green-hover: #4CAF50;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #242424;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --border-light: #353535;
    --shadow-light: rgba(0,0,0,0.3);
    --shadow-medium: rgba(0,0,0,0.4);
    --accent-gold: #F8B741;
    --accent-gold-hover: #ffc107;
    --accent-green: #5CC279;
    --accent-green-hover: #66d9ef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode toggle */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 5rem;
    z-index: 1001;
    background: var(--accent-gold);
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-gold-hover);
    transform: scale(1.05);
}

.theme-toggle span {
    font-size: 18px;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background-color: var(--accent-gold);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: var(--accent-gold-hover);
}

.hamburger {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
}

.hamburger > span,
.hamburger > span::before,
.hamburger > span::after {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.hamburger > span::before {
    content: '';
    top: -8px;
}

.hamburger > span::after {
    content: '';
    top: 8px;
}

.menu-toggle.is-active .hamburger > span {
    transform: rotate(45deg);
}

.menu-toggle.is-active .hamburger > span::before {
    top: 0;
    transform: rotate(0deg);
}

.menu-toggle.is-active .hamburger > span::after {
    top: 0;
    transform: rotate(90deg);
}

/* Main content */
.content {
    flex: 1;
    background-color: var(--bg-primary);
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.main_title {
    background-color: var(--bg-secondary);
    border-bottom: 3px solid var(--accent-gold);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow-light);
    transition: all 0.3s ease;
}

.main_title h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

/* Add article button */
.end_buttons {
    padding: 1.5rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.new_input {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background-color: var(--accent-gold);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.new_input:hover {
    background-color: var(--accent-gold-hover);
}

/* Articles section */
.main_content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Error page styles */
.error-message {
    text-align: center;
    background-color: var(--bg-secondary);
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.error-message h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.error-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.error-message p:last-child {
    margin-bottom: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive design */
@media (max-width: 768px) {
    .theme-toggle {
        right: 6rem;
        top: 0.5rem;
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .theme-toggle span {
        font-size: 16px;
    }

    .menu-toggle {
        display: block;
        top: 0.5rem;
        right: 0.5rem;
        width: 45px;
        height: 45px;
    }

    .content {
        width: 100%;
    }

    .main_title {
        padding: 3.5rem 1rem 1.5rem;
    }

    .main_title h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .main_content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        right: 5rem;
        top: 0.5rem;
        width: 35px;
        height: 35px;
        padding: 6px;
    }

    .theme-toggle span {
        font-size: 14px;
    }

    .menu-toggle {
        right: 0.5rem;
        top: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .hamburger {
        width: 20px;
    }

    .main_title h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .main_title {
        padding: 3rem 0.5rem 1rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main_title {
        padding: 2rem 1rem 1rem;
    }

    .main_title h1 {
        font-size: 1.6rem;
    }

    .theme-toggle {
        top: 0.5rem;
        right: 5rem;
    }
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .theme-toggle, .menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}
