: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: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    min-height: 56px;
    font-family: var(--font-primary);
}

.header-top {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.header h1,
.header-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.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: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
}

.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: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-primary);
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
}

.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: var(--font-primary);
    height: 36px;
}

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

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

/* Search input styles */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 16px;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}



/* Responsive styles */
@media (max-width: 768px) {
    .header {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 16px;
        min-height: 50px;
    }

    .header-top {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
    }

    .header h1,
    .header-title {
        font-size: 16px;
        flex-shrink: 0;
    }

    .header-actions {
        margin-left: auto;
        flex-shrink: 0;
    }

    .header-actions .theme-toggle {
        padding: 6px 8px;
        font-size: 12px;
        font-family: var(--font-primary);
        height: 32px;
    }

    .header-actions .action-btn {
        padding: 6px 8px;
        font-family: var(--font-primary);
        height: 32px;
    }

    .header-actions .theme-toggle .material-icons {
        font-size: 14px !important;
    }

    .theme-text {
        display: none;
    }

    .header-actions .action-btn span:not(.material-icons) {
        display: none;
    }

    .search-container {
        margin: 0 8px;
        max-width: none;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        font-family: var(--font-primary);
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
        min-height: 48px;
    }

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

    .search-container {
        margin: 0 6px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-actions .action-btn {
        padding: 4px 6px;
        height: 28px;
        font-size: 11px;
    }

    .header-actions .theme-toggle {
        padding: 4px 6px;
        height: 28px;
        font-size: 11px;
    }

    .notes-navigation {
        margin-left: 6px;
        height: 28px;
        font-size: 13px;
    }

    .breadcrumb-item {
        padding: 6px 8px;
        min-height: 26px;
        font-size: 13px;
    }

    .breadcrumb-separator {
        font-size: 11px;
        margin: 0 3px;
    }
}
