@import url('mobile-ui.css');
@import url('ai-status.css');
@import url('question-style.css');
@import url('chat-style.css');
@import url('broker-recruit.css');

:root {
    /* Brand Colors - Friendlier & Modern */
    --primary-color: #4F7BF5;
    /* Soft Royal Blue */
    --primary-dark: #3A5FBF;
    --accent-color: #FF8BA7;
    /* Soft Pink/Coral for charm */
    --accent-yellow: #FFD93D;
    /* Pop Yellow */

    /* Backgrounds */
    --bg-color: #F9FAFC;
    /* slightly cooler white */
    --surface-color: #FFFFFF;

    /* Typography */
    --text-main: #2D3436;
    /* Softer Black */
    --text-muted: #8898AA;

    /* Shapes & Depth */
    --border-color: #F1F3F5;
    --radius-md: 16px;
    /* Rounder */
    --radius-lg: 28px;
    /* Very Round */
    --shadow-sm: 0 4px 12px rgba(100, 110, 140, 0.08);
    /* Colored subtle shadow */
    --shadow-md: 0 12px 32px rgba(79, 123, 245, 0.12);
    /* Blue-tinted shadow */

    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    background: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

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

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

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

.menu-btn {
    font-size: 24px;
    color: var(--text-main);
    padding: 5px;
    cursor: pointer;
}

/* Side Menu (Drawer) - Fixed Selector */
#side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    /* Hidden by default */
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2001;
    /* Above modal overlay */
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#side-menu.active {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.close-menu {
    font-size: 24px;
    color: var(--text-muted);
}

.menu-list {
    list-style: none;
    padding: 0;
}

.menu-list li {
    padding: 15px 0;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: color 0.2s;
}

.menu-list li:hover {
    color: var(--primary-color);
}

#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Hero Section */
.hero {
    padding-top: 140px;
    padding-bottom: 100px;
    text-align: center;
    background: radial-gradient(circle at 70% 10%, rgba(255, 139, 167, 0.08) 0%, rgba(79, 123, 245, 0.06) 40%, transparent 70%),
        radial-gradient(circle at 20% 90%, rgba(255, 217, 61, 0.08) 0%, transparent 50%);
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    word-break: keep-all;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 400;
    word-break: keep-all;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(79, 123, 245, 0.35);
    /* Stronger glow */
}

.btn-primary:active {
    transform: scale(0.96);
    /* Clicky feel */
}

/* Features Section */
.features {
    background: var(--surface-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.feature-card {
    text-align: center;
    padding: 40px 30px;
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 20px;
    display: inline-block;
}

.feature-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.feature-desc {
    color: var(--text-muted);
    font-size: 15px;
}

/* Footer */
.footer {
    padding: 60px 0;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    /* Fix: Ensure hero content is not covered by fixed header */
    .hero {
        padding-top: 120px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Fix: Reduce padding on mobile for better text fit */
    .feature-card {
        padding: 30px 20px;
    }

    .btn-primary {
        width: 100%;
        max-width: 300px;
    }

    /* Fix: Footer readability on mobile */
    .footer {
        padding: 40px 0;
    }

    .footer-info {
        font-size: 13px;
        word-break: keep-all;
    }
}

/* App Container (Hidden by default) */
#app-view {
    display: none;
    min-height: 100vh;
    padding-top: 80px;
}

#app-view.active {
    display: block;
}

/* Fade Transitions */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

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

/* App View Components */
.mode-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 280px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 59, 92, 0.1);
}

.question-container {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
}

.step-indicator {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 500;
}

.question-title {
    font-size: 24px;
    margin-bottom: 40px;
    word-break: keep-all;
}

.answer-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-option {
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: white;
    font-size: 16px;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.btn-option:hover,
.btn-option.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.input-field {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--primary-color);
}

.btn-next {
    background: var(--primary-color);
    color: white;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
}

.footer-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    margin-right: 15px;
}

.footer-link-btn:hover {
    color: var(--text-main);
}

.footer-link-btn.bold {
    font-weight: 700;
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    width: 100%;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #444;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

@media (max-width: 768px) {
    .modal-card {
        width: 95%;
        max-height: 90vh;
    }

    /* Fix: Mobile keyboard covering input/button */
    .question-container {
        padding-bottom: 40vh;
    }
}

/* Stepper Progress Bar */
.stepper-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    transition: all 0.2s ease;
    cursor: default;
}

.step-dot.completed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    cursor: pointer;
}

.step-dot.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(0, 59, 92, 0.1);
}

.step-dot.future {
    background-color: transparent;
    /* Empty for future steps */
}

/* Region Horizontal Selector (New) */
.region-h-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.region-h-item {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.region-h-item.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #F0F4FF;
    /* Very light blue */
}

.region-h-item.filled {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.region-h-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Region Modal Grid */
.region-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.region-modal-btn {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.2s;
    text-align: center;
    word-break: keep-all;
}

.region-modal-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #F8F9FA;
}

.region-modal-btn.selected {
    border-color: var(--primary-color);
    background: #E8F0FE;
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

/* Modal Search Input */
.region-search-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 15px;
    outline: none;
    background: #f9fafc;
}

.region-search-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 123, 245, 0.1);
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 769px) {
    .desktop-nav {
        display: flex;
        gap: 30px;
        align-items: center;
        margin-left: 40px;
        margin-right: auto;
    }

    .desktop-nav a {
        font-size: 16px;
        color: var(--text-main);
        font-weight: 600;
        text-decoration: none;
        padding: 5px 0;
        transition: color 0.2s;
    }

    .desktop-nav a:hover {
        color: var(--primary-color);
    }

    /* Hide Mobile Bottom Nav on Desktop */
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Typing Indicator */
.typing-dots {
    display: inline-block;
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    background-color: #aaa;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hide Modal Footer in Login Mode */
#modal-overlay.login-mode .modal-footer {
    display: none !important;
}
/* Summary Card Styles (Added for AI Chat) */
.summary-card-container {
    position: sticky;
    top: 60px; /* Adjust based on header */
    z-index: 99;
    padding: 10px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.summary-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item.full-width {
    grid-column: span 2;
}

.summary-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}

.summary-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
}
