/* ================================
   Signal Discovery Tool - Styles
   ================================ */

:root {
    /* Brand Colors */
    --color-bg: #1e1a17;
    /* Warm Black */
    --color-text: #f2efea;
    /* Off-White */
    --color-primary: #e97451;
    /* Orange */
    --color-border: #2e2e2e;
    /* Dark Grey */

    /* Surfaces */
    --color-surface: #1e1a17;
    /* Match bg for clean look */
    --color-surface-elevated: #262320;
    /* Slightly lighter for inputs */

    /* Text Variations */
    --color-text-muted: rgba(242, 239, 234, 0.6);
    --color-text-subtle: rgba(242, 239, 234, 0.4);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(233, 116, 81, 0.3);
    /* Orange glow */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #e97451 0%, #ff9f7d 100%);
    --gradient-hero-glow: radial-gradient(circle at 50% 0%, rgba(233, 116, 81, 0.2) 0%, rgba(30, 26, 23, 0) 60%);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    background-image: var(--gradient-hero-glow);
    background-repeat: no-repeat;
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Gloock', serif;
    font-weight: 400;
}

/* Container - Wider like Adrian's */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

.top-nav {
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-xl);
    display: flex;
    /* Align left */
    justify-content: flex-start;
}

.nav-logo {
    height: 48px;
    /* Adjustable height */
    width: auto;
    object-fit: contain;
}

.logo-placeholder {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Hero Section - More breathing room */
.hero {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-3xl);
    /* More top padding for logo area */
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    /* Very subtle white bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--color-text);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    /* Orange dot */
    box-shadow: 0 0 8px var(--color-primary);
}

.badge-text {
    font-weight: 600;
}

.badge-divider {
    color: var(--color-text-subtle);
}

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

/* Hero H1 - Wider container */
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xl);
    line-height: 1.2;
    max-width: 1000px;
    /* Wider text container */
    margin-left: auto;
    margin-right: auto;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtitle - Improved readability */
.subtitle {
    font-size: 1.25rem;
    /* Larger font */
    color: var(--color-text-muted);
    max-width: 900px;
    /* Wider than before (800px) */
    margin: 0 auto var(--space-2xl);
    /* More bottom space */
    line-height: 1.6;
    /* Better reading flow */
}

.cta-text {
    font-size: 1rem;
    color: var(--color-text);
    margin: 0 auto var(--space-2xl);
}

.cta-text strong {
    color: var(--color-primary);
}

/* Form Section - Light Theme Refinement */
.form-section {
    background: var(--color-text);
    /* Off-white #f2efea */
    border: 1px solid rgba(30, 26, 23, 0.08);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 20px 50px rgba(30, 26, 23, 0.15);
    /* Enhanced 3D depth */
    color: var(--color-bg);
    /* Dark text #1e1a17 */
    max-width: 680px;
    /* Keep form narrower than hero container */
    margin: 0 auto;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(30, 26, 23, 0.1);
    /* Dark bg for steps on light form */
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-bg);
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--color-primary);
    color: white;
}

.step.completed .step-number {
    background: var(--color-bg);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: rgba(30, 26, 23, 0.6);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--color-bg);
}

.step-line {
    width: 80px;
    height: 2px;
    background: rgba(30, 26, 23, 0.1);
    margin: 0 var(--space-md) var(--space-lg);
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-bg);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    background: #ffffff;
    border: 1px solid rgba(30, 26, 23, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-bg);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(233, 116, 81, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(30, 26, 23, 0.4);
}

.helper-text {
    display: block;
    font-size: 0.75rem;
    color: rgba(30, 26, 23, 0.5);
    margin-top: var(--space-xs);
}

/* Mobile-specific input constraints */
@media (max-width: 480px) {
    .form-group input[type="date"],
    .form-group input[type="time"] {
        max-width: 100%;
        overflow: hidden;
    }

    /* Ensure native pickers are properly contained */
    .form-group {
        overflow: visible;
        position: relative;
    }
}

/* Brand Enemy Section */
.brand-enemy-label {
    font-size: 1.125rem !important;
    line-height: 1.5;
    color: var(--color-bg);
}

.brand-enemy-subtitle {
    color: rgba(30, 26, 23, 0.6);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-bg);
    /* Dark text for contrast */
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(233, 116, 81, 0.5);
}

.btn-secondary {
    background: rgba(30, 26, 23, 0.05);
    color: var(--color-bg);
    border: 1px solid rgba(30, 26, 23, 0.1);
}

.btn-secondary:hover {
    background: rgba(30, 26, 23, 0.1);
}

.button-group {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.btn-generate {
    flex: 1;
}

/* Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-top: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.results-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.results-header h2 {
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Profile Content */
.profile-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.profile-content h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.profile-content h2 {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.profile-content p {
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
}

.profile-content strong {
    color: var(--color-text);
}

/* Download Section */
.download-section {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    width: 100%;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--space-lg) var(--space-lg);
        /* Reduced side margins for tablet */
    }

    .hero h1 {
        font-size: 2rem;
        letter-spacing: 0.02em;
    }

    .subtitle {
        max-width: 100%;
        font-size: 1.125rem;
        /* Slightly smaller on tablet */
    }

    .hero-badge {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-md) var(--space-xl);
        /* More white space on sides */
    }

    .top-nav {
        justify-content: center;
        /* Center logo */
        margin-bottom: var(--space-md);
        /* Raise content */
        padding-top: var(--space-sm);
    }

    .nav-logo {
        height: 32px;
        /* Smaller logo */
    }

    .hero {
        padding: var(--space-md) 0 var(--space-2xl);
        /* Raise content */
    }

    .hero h1 {
        font-size: 1.6rem;
        /* Slightly smaller to fit better with margins */
    }

    .badge-divider {
        display: none;
    }

    .form-section,
    .results-section {
        padding: var(--space-lg) var(--space-md);
    }

    .results-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        flex-direction: column;
    }

    .download-section {
        flex-direction: column;
        align-items: center;
    }

    .desktop-break {
        display: none;
    }
}

@media (min-width: 481px) {
    .desktop-break {
        display: block;
        margin-bottom: var(--space-xs);
        /* Optional: add a bit of space */
        content: "";
        /* formatting hint */
    }
}

/* City Autocomplete Dropdown */
.city-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: var(--space-xs);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: none;
}

.city-results.show {
    display: block;
}

.city-result-item {
    padding: var(--space-md);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    font-size: 0.95rem;
}

.city-result-item:last-child {
    border-bottom: none;
}

.city-result-item:hover {
    background: rgba(233, 116, 81, 0.1);
    color: var(--color-primary);
}

.city-message {
    padding: var(--space-md);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-style: italic;
    text-align: center;
}