/* Shared theme styles for WNC Platform */

/* Global Reset for Consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Light theme (default) */
:root,
.light-theme {
    /* Primary colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    
    /* Border and dividers */
    --border-color: #ddd;
    --border-light: #eee;
    
    /* Header and navigation */
    --header-bg: #2c3e50;
    --header-text: white;
    
    /* Status colors */
    --success: #27ae60;
    --error: #e74c3c;
    --info: #3498db;
    --warning: #f39c12;
    
    /* Code and pre */
    --code-bg: #f8f9fa;
    --code-text: #333;
    
    /* Shadows and overlays */
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --modal-overlay: rgba(0, 0, 0, 0.5);
    
    /* Service card specific */
    --card-bg: white;
    --card-hover-transform: translateY(-5px);
    
    /* Links */
    --link-color: #3498db;
    --link-hover: #2980b9;
    
    /* Scrollbars */
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a8a8a8;
    
    /* Grid */
    --grid-color: rgba(128, 128, 128, 0.1);
}

/* Dark theme */
.dark-theme,
.dark-mode {
    /* Primary colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    
    /* Border and dividers */
    --border-color: #404040;
    --border-light: #4a4a4a;
    
    /* Header and navigation */
    --header-bg: #1f1f1f;
    --header-text: #e0e0e0;
    
    /* Status colors */
    --success: #4ade80;
    --error: #ef4444;
    --info: #60a5fa;
    --warning: #fbbf24;
    
    /* Code and pre */
    --code-bg: #1f1f1f;
    --code-text: #e0e0e0;
    
    /* Shadows and overlays */
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --modal-overlay: rgba(0, 0, 0, 0.7);
    
    /* Service card specific */
    --card-bg: #2d2d2d;
    --card-hover-transform: translateY(-5px);
    
    /* Links */
    --link-color: #60a5fa;
    --link-hover: #93bbfc;
    
    /* Scrollbars */
    --scrollbar-track: #2d2d2d;
    --scrollbar-thumb: #4a4a4a;
    --scrollbar-thumb-hover: #5a5a5a;
    
    /* Grid */
    --grid-color: rgba(255, 255, 255, 0.05);
}

/* Apply theme variables to root elements */
html {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Theme transition */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle button styles */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--header-text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-icon-light,
.theme-icon-dark {
    display: inline-block;
    line-height: 1;
}

/* Common dark theme adjustments */
.dark-theme input,
.dark-theme textarea,
.dark-theme select,
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
    border-style: solid !important;  /* Override browser inset default */
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder,
.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 0.7;
}

.dark-theme code,
.dark-theme pre,
.dark-mode code,
.dark-mode pre {
    background: var(--code-bg);
    color: var(--code-text);
}

.dark-theme a {
    color: var(--link-color);
}

.dark-theme a:hover {
    color: var(--link-hover);
}

/* Smooth transitions for theme-aware elements */
input, textarea, select, code, pre, .service-card, .info-section {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Global Scrollbar Styling */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Dark theme specific scrollbar adjustments */
.dark-theme *::-webkit-scrollbar-thumb,
.dark-mode *::-webkit-scrollbar-thumb {
    border-color: #2a2a2a;
}
/* =============================================
   App Structure & Containers
   Merged from app-core.css
   ============================================= */


/* Custom Properties - Extended */
:root {
    --wellnecity-purple: #7B68EE;
    --wellnecity-purple-dark: #6B46C1;
    --wellnecity-purple-light: #9B88FF;
}

/* Body overflow control */
body {
    overflow: hidden;
    transition: background-color 500ms ease;
}

/* Exception: Allow scrolling for showcase pages */
body.showcase-page {
    overflow: auto;
}

/* Splash Container Base */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 500ms ease;
    z-index: 100;
    background: inherit;
}

.splash-container.fade-out {
    opacity: 0;
}

/* Workflow Studio Container */
#workflow-studio {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#workflow-studio.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

#workflow-studio.transitioning {
    animation: fadeInFromSplash 1s ease-out;
}

#workflow-studio.transitioning .app-container {
    animation: fadeInFromSplash 1.2s ease-out;
}

/* Body States for Splash Transitions */
body.loading-from-splash {
    opacity: 0;
}

body.loading-from-splash .app-container {
    opacity: 0;
    filter: blur(20px);
}

body.from-splash {
    opacity: 1;
    animation: fadeInFromSplash 1s ease-out;
}

body.from-splash .app-container {
    animation: fadeInFromSplash 1.2s ease-out;
}

/* Hide header in Workflow Studio - IDE bar provides navigation */
.app-header {
    display: none !important;
}
