/* ============================================================================
   MARKET CONSENSUS - MODERN MINIMALIST STYLES
   ============================================================================ */

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

:root {
    /* Colors - Modern Palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    
    --secondary: #64748b;
    --secondary-hover: #475569;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-xl) 0;
}

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

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.logo-icon {
    font-size: 2.5rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main {
    padding: var(--spacing-2xl) 0;
    min-height: calc(100vh - 200px);
}

/* ============================================================================
   SEARCH SECTION
   ============================================================================ */

.search-section {
    margin-bottom: var(--spacing-2xl);
}

.search-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.search-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: 0.95rem;
}

.search-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.ticker-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 500;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-transform: uppercase;
}

.ticker-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.ticker-input::placeholder {
    color: var(--text-tertiary);
    text-transform: none;
    font-weight: 400;
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-dark);
}

.btn-loader {
    display: inline-block;
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */

.results-section {
    animation: fadeIn 0.3s ease;
}

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

.current-ticker {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.ticker-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.ticker-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.btn-reset {
    margin-left: auto;
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.btn-reset:hover {
    background: var(--border-dark);
    transform: rotate(90deg);
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.action-btn {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-align: left;
}

.action-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.action-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.action-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.action-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Help Icon */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--text-tertiary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.help-icon:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* ============================================================================
   DISPLAY AREA & VIEW PANELS
   ============================================================================ */

.display-area {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.view-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-panel.active {
    display: block;
}

.panel-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.panel-content {
    padding: var(--spacing-xl);
    min-height: 500px;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--spacing-lg);
}

.loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.loading-subtext {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Spinner */
.spinner,
.spinner-large {
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 20px;
    height: 20px;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--spacing-md);
}

.error-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.error-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-subtext {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 500px;
    text-align: center;
}

/* ============================================================================
   CHART CONTAINER
   ============================================================================ */

.chart-container {
    width: 100%;
    min-height: 500px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

/* ============================================================================
   RESULTS CONTAINERS (will be styled in later phases)
   ============================================================================ */

.similar-results,
.sensitivity-results,
.volatility-results {
    /* Placeholder - will be enhanced in later phases */
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast {
    position: fixed;
    bottom: -100px;
    right: var(--spacing-xl);
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 300px;
    max-width: 500px;
    transition: bottom 0.3s ease;
    z-index: 1000;
}

.toast.show {
    bottom: var(--spacing-xl);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

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

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

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

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .header {
        padding: var(--spacing-lg) 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .search-card {
        padding: var(--spacing-lg);
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .ticker-input {
        font-size: 1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .current-ticker {
        flex-wrap: wrap;
    }
    
    .btn-reset {
        margin-left: 0;
    }
    
    .panel-content {
        padding: var(--spacing-md);
        min-height: 300px;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .toast {
        right: var(--spacing-md);
        left: var(--spacing-md);
        min-width: auto;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
    display: none !important;
}

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

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

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

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