/*
  SHARED STYLES - Used by all pages
  - CSS Variables and theme management
  - Base styles and layout
  - Logo swapping logic
  - Footer and theme toggle
  - Common animations
*/

/* 1. THEME & GLOBAL VARIABLES */
:root {
    --font-main: 'Space Grotesk', sans-serif;
    --font-primary: 'Space Grotesk', sans-serif;
    --border-radius-main: 12px;
    --radius-main: 20px;
    --radius-small: 12px;
    --transition-speed: 0.3s;
    --max-width-container: 550px;
    
    /* Default dark theme colors */
    --primary: #00ffa3;
    --secondary: #ff4d4d;
    --bg-dark: rgba(0, 0, 0, 0.7);
    --bg-darker: rgba(0, 0, 0, 0.9);
    --text-light: #f1f1f1;
    --text-muted: #aaa;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* 2. BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 2rem 1rem;
    justify-content: center;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* 3. DARK MODE */
body.dark-mode {
    --primary: #60a5fa;
    --secondary: #dc2626;
    --bg-main: linear-gradient(135deg, #2a1520 0%, #3d1a35 100%);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --model-bg: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(96, 165, 250, 0.15);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 6px 20px rgba(96, 165, 250, 0.2);
    background: var(--bg-main);
    color: var(--text-main);
}

/* 4. LIGHT MODE */
body.light-mode {
    --primary: #3b82f6;
    --secondary: #ec4899;
    --bg-main: linear-gradient(135deg, #dbeafe 0%, #fce7f3 100%);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --model-bg: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(59, 130, 246, 0.2);
    --card-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    --card-shadow-hover: 0 4px 12px rgba(236, 72, 153, 0.15);
    background: var(--bg-main);
    color: var(--text-main);
}

/* 5. CONTAINER */
.container {
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 1rem;
    padding-top: 0.8rem;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

/* 6. HEADER */
.hall-header {
    text-align: center;
    margin: 2rem auto 4rem;
    position: relative;
    display: inline-block;

}

/* 7. LOGO SWAP CONTAINER */
.logo-swap-container {
    display: inline-block;
    position: relative;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-swap-container:hover {
    transform: scale(1.05);
}

.logo-swap-container .logo-img {
    height: 30px;
    width: auto;
    display: inline-block;
    transition: opacity var(--transition-speed) ease;
}

/* Page-specific logo sizes are defined in their respective CSS files:
   - hallstyle.css for .hall-logo
   - michelle.css for .michelle-logo
*/

/* 8. LOGO SWAP LOGIC */
/* Light mode: show light logo, hide dark */
.light-mode .logo-dark { opacity: 0; }
.light-mode .logo-light { opacity: 1; }

/* Light mode hover: flip */
.light-mode .logo-swap-container:hover .logo-dark { opacity: 1; }
.light-mode .logo-swap-container:hover .logo-light { opacity: 0; }

/* Dark mode: show dark logo, hide light */
.dark-mode .logo-dark { opacity: 1; }
.dark-mode .logo-light { opacity: 0; }

/* Dark mode hover: flip */
.dark-mode .logo-swap-container:hover .logo-dark { opacity: 0; }
.dark-mode .logo-swap-container:hover .logo-light { opacity: 1; }

/* 9. FOOTER */
.footer {
    margin-top: 1.5rem;
    text-align: center;
    padding: 0.8rem 0;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    height: 30px;
    width: 120px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-toggle .logo-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 10. ACCESSIBILITY */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 11. ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 12. MEDIA QUERIES */
@media (max-width: 768px) {
    .container {
        padding: 0.8rem;
    }
    
    .hall-header {
        margin: 0.8rem auto 2.5rem;
    }
    body {
            padding: 1rem 0.75rem;
            gap: 1rem;
    }
}
