/* assets/css/base.css - Global base styles */

/* ============================================================================
   CSS VARIABLES - Theme & Font Size
   ============================================================================ */
:root {
    /* Light theme (default) */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --text-secondary: #7f8c8d;
    --text-heading: #2c3e50;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --card-hover: rgba(0, 0, 0, 0.05);
    --header-bg: linear-gradient(135deg, #505050 0%, #2a2a2a 100%);
    --header-text: #ffffff;

    /* Font sizes - normal (default) */
    --font-size-base: 16px;
    --font-size-h1: 2.25em;
    --font-size-h2: 1.75rem;
    --font-size-h3: 1.25rem;
}

/* Dark theme */
html[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-heading: #ffffff;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --card-hover: rgba(255, 255, 255, 0.05);
    --header-bg: linear-gradient(135deg, #3a3a3a 0%, #1f1f1f 100%);
    --header-text: #e0e0e0;
}

/* Font size - small */
[data-font-size="small"] {
    --font-size-base: 14px;
    --font-size-h1: 2em;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.125rem;
}

/* Font size - large */
[data-font-size="large"] {
    --font-size-base: 18px;
    --font-size-h1: 2.5em;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    flex: 1;
    background: var(--bg-secondary);
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-content {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.site-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-logo {
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.site-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.btn-logout {
    background: rgba(231, 76, 60, 0.8);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(231, 76, 60, 1);
}

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        width: 100%;
    }

    .site-nav a {
        flex: 1;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}