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

:root {
    --primary-blue: #1e40af;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --white: #ffffff;
    --text-dark: #1e40af;
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    --gradient-secondary: linear-gradient(45deg, #dbeafe 0%, #ffffff 100%);
    --gradient-hero: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    --gradient-animated: linear-gradient(270deg, #1e40af, #3b82f6, #60a5fa, #93c5fd);
    --shadow-light: 0 4px 20px rgba(30, 64, 175, 0.1);
    --shadow-medium: 0 8px 25px rgba(30, 64, 175, 0.15);
    --shadow-heavy: 0 12px 35px rgba(30, 64, 175, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(270deg, #dbeafe, #bfdbfe, #93c5fd, #60a5fa);
    background-size: 800% 800%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Light Effects */
.light-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.light-effects::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.light-effects::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Sparkles */
.sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--secondary-blue);
    border-radius: 50%;
    animation: sparkle 3s linear infinite;
}

.sparkle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 40%; left: 80%; animation-delay: 1s; }
.sparkle:nth-child(3) { top: 70%; left: 30%; animation-delay: 2s; }
.sparkle:nth-child(4) { top: 30%; left: 60%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { top: 80%; left: 70%; animation-delay: 0.5s; }

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.8rem 0;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.logo-container {
    font-size: 1.3rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--gradient-secondary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    font-size: 0.9rem;
}

.nav-back:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    padding: 1rem 0;
}

.ai-hero {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
    padding: 0 10px;
}

.ai-hero h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.ai-hero p {
    font-size: 1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Form Container */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-heavy);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    width: 100%;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

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

/* Progress Bar */
.progress-container {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-heavy);
    margin: 2rem auto 0;
    max-width: 800px;
    text-align: center;
}

.progress-container.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.progress-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.progress-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 25px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 25px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--secondary-blue);
    font-weight: 500;
}

.progress-steps {
    margin-top: 1.5rem;
    text-align: left;
}

.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.progress-step.active {
    background: rgba(59, 130, 246, 0.1);
}

.progress-step.completed {
    background: rgba(34, 197, 94, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    display: none;
}

.progress-bar .bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    animation: loading 2s infinite linear;
    transition: width 0.3s ease;
}

.result-box {
    background: #f9f9f9;
    border-left: 5px solid #2575fc;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    white-space: pre-wrap;
}

.result-text {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}


@keyframes loading {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.step-icon.pending {
    background: #e5e7eb;
    color: #9ca3af;
}

.step-icon.active {
    background: var(--secondary-blue);
    color: white;
}

.step-icon.completed {
    background: #22c55e;
    color: white;
}

.step-text {
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 10% 15px;
    padding: 1.5rem;
    width: auto;
    border-radius: 15px;
    position: relative;
    box-shadow: var(--shadow-heavy);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-blue);
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.3rem;
}

.modal textarea {
    height: 100px;
    margin-bottom: 1rem;
}

/* Result Section */
.result-section {
    max-width: 800px;
    margin: 2rem auto 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-heavy);
    animation: fadeInUp 0.8s ease;
}

.result-section h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.result-content {
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-blue);
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--secondary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .ai-hero h1 {
        font-size: 1.6rem;
    }

    .ai-hero p {
        font-size: 0.95rem;
    }

    .form-container {
        margin: 0 10px;
        padding: 1.2rem;
    }

    .progress-container {
        margin: 2rem 10px 0;
        padding: 1.5rem 1.2rem;
    }

    .result-section {
        margin: 2rem 10px 0;
        padding: 1.2rem;
    }

    .modal-content {
        margin: 15% 10px;
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header-nav {
        padding: 0 10px;
    }

    .logo-container {
        font-size: 1.1rem;
    }

    .nav-back {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .ai-hero h1 {
        font-size: 1.4rem;
    }

    .ai-hero p {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .progress-title {
        font-size: 1.1rem;
    }

    .progress-subtitle {
        font-size: 0.9rem;
    }
}
