:root {
    /* Colors - Light Theme (Default) */
    --bg-color: #ffffff;
    --text-color: #111111;
    --text-color-secondary: #888888;
    --border-color: #e0e0e0;
    --accent-color: #000000;

    /* Layout */
    --header-height: 60px;
    --bottom-bar-height: 80px;
    --content-max-width: 1200px;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --blur-bg: rgba(255, 255, 255, 0.85);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --text-color-secondary: #a0a0a0;
    --border-color: #333333;
    --accent-color: #ffffff;
    --blur-bg: rgba(26, 26, 26, 0.85);
}

/* Sepia Theme Variables */
[data-theme="sepia"] {
    --bg-color: #f6f1d1;
    --text-color: #5f4b32;
    --text-color-secondary: #8b765d;
    --border-color: #e6dec1;
    --accent-color: #5f4b32;
    --blur-bg: rgba(246, 241, 209, 0.85);
}

/* Reset */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body,
html {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    /* App-like feel */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* App Container */
#app {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* View Handling */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-color);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 10;
    display: none;
    /* JS will toggle flex/block */
}

.view.active {
    display: flex;
    flex-direction: column;
    z-index: 20;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}