/* Global styles: variables, reset, body, theme toggle. Load first on all pages. */

:root {
    --primary-color: #1a472a;
    --primary-light: #2d5a3d;
    --secondary-color: #8b4513;
    --accent-color: #d4af37;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #dddddd;
    --error: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --input-bg: #f8f9fa;
    --card-bg: #f8f9fa;
}

.dark-mode {
    --primary-color: #4a9b5f;
    --primary-light: #5cb377;
    --secondary-color: #b87333;
    --accent-color: #f4d03f;
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --border: #404040;
    --error: #ff6b6b;
    --warning: #ffd93d;
    --success: #51cf66;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --input-bg: #353535;
    --card-bg: #353535;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    padding: 1rem;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 56px;
}

.theme-toggle:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-icon {
    display: block;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Shared tools header/footer (used when tools include shared/header.html and footer.html) */
.tools-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.tools-hub-home {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.tools-hub-home:hover {
    color: var(--primary-color);
}

.tools-hub-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.tools-hub-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.tools-hub-footer a:hover {
    text-decoration: underline;
}

.tools-hub-footer-legal {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.9;
}
