@import url('https://fonts.googleapis.com/css2?family=Playfair+Display+SC:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap');

:root {
    /* Light theme (default) */
    --bg-primary: #f8f9fa;
    --bg-secondary: white;
    --bg-tertiary: #f1f3f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --border-light: #f1f3f4;
    --accent-color: #1a73e8;
    --accent-hover: #1557b0;
    --accent-bg: #e8f0fe;
    --hover-bg: #f8f9fa;
    --shadow: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12), 0 5px 5px -3px rgba(0, 0, 0, .2);
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --border-color: #30363d;
    --border-light: #21262d;
    --accent-color: #58a6ff;
    --accent-hover: #388bfd;
    --accent-bg: #1c2128;
    --hover-bg: #21262d;
    --shadow: 0 8px 10px 1px rgba(0, 0, 0, .4), 0 3px 14px 2px rgba(0, 0, 0, .3), 0 5px 5px -3px rgba(0, 0, 0, .5);
}

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-top {
    display: contents;
}

.header h1,
.header-title {
    font-family: 'Playfair Display SC', serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* Theme toggle button */
.header-actions .theme-toggle {
    background: none;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Libre Baskerville', serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-actions .theme-toggle:hover {
    background: var(--hover-bg);
}

/* Unified header styling for all pages */

/* Action buttons */
.header-actions .action-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Libre Baskerville', serif;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-actions .action-btn:hover {
    background: var(--accent-hover);
}

.header-actions .action-btn.secondary {
    background: none;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    font-family: 'Libre Baskerville', serif;
}

.header-actions .action-btn.secondary:hover {
    background: var(--hover-bg);
}

/* General utility classes */
.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .header-top {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .header h1,
    .header-title {
        font-size: 18px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}
