/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Neutrals */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #0ea5e9 100%);
    --gradient-bg: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Animated Background ===== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: 50%;
    right: -150px;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: 30%;
}


/* ===== Container ===== */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.header-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 540px;
    margin: 0 auto;
}

/* ===== Form Card ===== */
.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    margin-bottom: var(--space-2xl);
}

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ===== Form Groups ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.label-icon {
    font-size: 1.1rem;
}

/* ===== Form Inputs ===== */
.form-input,
.form-select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover,
.form-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ===== Select Wrapper ===== */
.select-wrapper {
    position: relative;
}

.form-select {
    appearance: none;
    cursor: pointer;
    padding-right: 48px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-sm);
}

.select-arrow {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.select-arrow svg {
    width: 20px;
    height: 20px;
}

.form-select:focus + .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* ===== Result Options (Radio Buttons) ===== */
.result-options {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.result-options input[type="radio"] {
    display: none;
}

.result-option {
    flex: 1;
    min-width: 60px;
    text-align: center;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.result-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.result-options input[type="radio"]:checked + .result-option {
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* ===== Submit Button ===== */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-top: var(--space-md);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
}

.submit-btn:hover .btn-icon svg {
    transform: translateX(4px);
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Success Message ===== */
.success-message {
    text-align: center;
    padding: var(--space-xl);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success), #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: white;
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.success-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Success Action Buttons */
.success-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.secondary-btn:active {
    transform: translateY(0);
}

.primary-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.primary-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .success-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Features Section ===== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 600px) {
    .features {
        grid-template-columns: 1fr;
    }
}

.feature {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.feature:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.feature-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 480px) {
    .container {
        padding: var(--space-lg) var(--space-md);
    }
    
    .header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .form-card {
        padding: var(--space-lg);
    }
    
    .result-option {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }
}

/* ===== AI Chat Button ===== */
.ai-chat-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-normal);
    z-index: 1000;
    animation: bounceIn 0.5s ease;
}

.ai-chat-btn svg {
    width: 22px;
    height: 22px;
}

.ai-chat-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.5);
}

.ai-chat-btn:active {
    transform: translateY(-1px) scale(0.98);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== AI Chat Modal ===== */
.ai-modal {
    display: none;
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: 600px;
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

.ai-modal.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 500px;
}

/* AI Modal Header */
.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ai-avatar {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-avatar svg {
    width: 24px;
    height: 24px;
}

.ai-header-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.ai-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ai-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.ai-close-btn svg {
    width: 18px;
    height: 18px;
}

/* AI Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.ai-message {
    display: flex;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.ai-bot {
    justify-content: flex-start;
}

.ai-message.ai-user {
    justify-content: flex-end;
}

.ai-message-content {
    max-width: 85%;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-bot .ai-message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--space-xs);
}

.ai-user .ai-message-content {
    background: var(--gradient-primary);
    border-bottom-right-radius: var(--space-xs);
}

/* AI Typing Indicator */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-md) var(--space-lg);
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(1) { animation-delay: 0s; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* AI Chat Input */
.ai-chat-input-container {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.ai-chat-input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-normal);
}

.ai-chat-input::placeholder {
    color: var(--text-muted);
}

.ai-chat-input:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.ai-send-btn:active {
    transform: scale(0.95);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-btn {
        right: 16px;
        bottom: 16px;
        padding: var(--space-md);
    }
    
    .ai-btn-text {
        display: none;
    }
    
    .ai-modal {
        right: 8px;
        left: 8px;
        bottom: 80px;
        width: auto;
        max-width: none;
    }
    
    .ai-modal-content {
        height: 450px;
    }
}
