/* Core CSS - Shared across all pages */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #3b82f6;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --text-color-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease;
}

/* Dark Mode */
html.dark-mode {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #94a3b8;
    --accent-color: #3b82f6;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-light: #cbd5e1;
    --text-color-secondary: #cbd5e1;
    --border-color: #334155;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

section {
    scroll-margin-top: 80px;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem !important;
}

/* Responsive Padding - Optimized for compact desktop view */
@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem !important;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem !important;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Forms */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-color);
    transition: var(--transition);
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: monospace;
    line-height: 1.5;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex-nowrap { 
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}
.flex-shrink-0 { flex-shrink: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.site-header {
    background-color: var(--background-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
    min-width: 0;
}

.logo {
    flex-shrink: 0;
    white-space: nowrap;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-light);
    white-space: nowrap;
}

.main-nav {
    flex-shrink: 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    flex-wrap: nowrap;
    align-items: center;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0.25rem;
    position: relative;
    white-space: nowrap;
    font-size: 0.9rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dark-mode-toggle::after {
    content: attr(data-mode);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.dark-mode-toggle:hover::after {
    opacity: 1;
    width: auto;
}

.dark-mode-toggle:hover {
    background-color: var(--surface-color);
}

/* Footer */
.site-footer {
    background-color: var(--surface-color);
    margin-top: auto;
    padding: 2rem 0 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h4 {
    margin-bottom: 0.625rem;
    margin-top: 0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.footer-section p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-light);
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.3rem;
    display: flex;
}

.footer-section ul li:last-child {
    margin-bottom: 0;
}

.footer-section a {
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0.25rem 0;
    white-space: nowrap;
}

.footer-bottom p:first-child {
    margin-top: 0;
}

.footer-note {
    font-size: 0.75rem !important;
}

/* Content Pages (Legal, etc.) */
.content-page {
    flex: 1;
    padding: 3rem 0;
}

.content-page h1 {
    margin-bottom: 2rem;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.content-page h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.content-page section {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.content-page p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.content-page ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-page ul li {
    margin-bottom: 0.5rem;
}

.content-page a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    transition: var(--transition);
}

.content-page a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.content-page small {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-color);
        box-shadow: var(--shadow-md);
        padding: 1rem;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        padding: 0 2rem;
    }

    .main-nav ul {
        gap: 0.5rem;
    }

    .main-nav a {
        font-size: 0.85rem;
        padding: 0.5rem 0.2rem;
    }
}

@media (min-width: 1200px) {
    .main-nav ul {
        gap: 1rem;
    }
}