/* main.css - Base styles and theme variables */

/* CSS Variables for consistent theming */
:root {
    /* Colors from your design */
    --bg-cream: #FAF9F6;
    --btn-blue: #6699BB;
    --btn-shadow: #4D738E;
    --card-bg: #EEF3F7;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #DDDDDD;
    --error-red: #D32F2F;
    --success-green: #388E3C;
    --warning-yellow: #F57C00;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-button: 0 6px 0 var(--btn-shadow);
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-dark);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

p {
    margin-bottom: var(--spacing-md);
}

/* Links */
a {
    color: var(--btn-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--btn-shadow);
}

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

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Main app container */
#app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    padding-top: 100px; /* Space for fixed menu button */
}

/* SPA View base styles */
.spa-view {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu button (always visible) */
.menu-button {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 60px;
    height: 60px;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 255, 0);
    z-index: 1000;
    transition: transform var(--transition-fast), opacity 0.3s ease;
    padding: 5px;
}

.menu-buttonwhite {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 60px;
    height: 60px;
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: transform var(--transition-fast), opacity 0.3s ease;
    padding: 5px;
}

.menu-button:hover {
    transform: scale(1.1);
}

.menu-button.menu-hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--card-bg);
    border-top: 3px solid var(--btn-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: var(--spacing-lg) auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: bottom var(--transition-normal);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    bottom: 30px;
}

.toast-success {
    background: var(--success-green);
}

.toast-error {
    background: var(--error-red);
}

.toast-warning {
    background: var(--warning-yellow);
}

/* Responsive design */
@media (min-width: 768px) {
    .spa-view {
        max-width: 600px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .spa-view {
        max-width: 800px;
    }
}

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

/* Print styles */
@media print {
    .menu-button,
    .ui-button,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .spa-view {
        max-width: 100%;
    }
}
