/* Modern CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --darker: #020617;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-secondary: linear-gradient(135deg, #06b6d4, #3b82f6);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Global Styles */
.ai-page {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--gray-800);
}

.container-custom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-white {
    background: white;
}

.section-gray {
    background: var(--gray-50);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--gray-500);
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 0 4rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #1e293b, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Feature Grid */
.feature-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 100px;
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.feature-item i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: 2rem;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* What is Section */
.whatis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.whatis-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.perfect-for {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.perfect-badge {
    background: var(--gray-100);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-weight: 500;
    color: var(--gray-700);
}

.whatis-image {
    background: var(--gradient-primary);
    border-radius: 32px;
    padding: 2rem;
    text-align: center;
    color: white;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.step-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 1rem;
}

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.example-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s;
    cursor: pointer;
}

.example-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.example-emoji {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

/* Why Grid */
.why-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.why-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.why-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

/* AI Assistant Section */
.assistant-box {
    background: var(--gray-900);
    color: white;
    border-radius: 32px;
    padding: 3rem;
    text-align: center;
}

.assistant-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

/* Pro Tips */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.tip-card {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Generator Section */
.generator-box {
    background: white;
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.generator-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
}

.generator-body {
    padding: 2rem;
}

.prompt-textarea {
    width: 100%;
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 1rem;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.controls-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 150px;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    display: block;
}

.style-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.style-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
}

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

.currency-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: white;
}

.generate-btn {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s;
}

.generate-btn:hover {
    transform: scale(1.02);
}

/* Editable Invoice Styles */
.editable-field {
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    position: relative;
}

.editable-field:hover {
    background: #eef2ff;
    outline: 1px dashed var(--primary);
}

.editable-field.editing {
    background: #eef2ff;
    outline: 2px solid var(--primary);
}

.editable-field i {
    opacity: 0;
    margin-left: 5px;
    font-size: 12px;
    transition: opacity 0.2s;
}

.editable-field:hover i {
    opacity: 1;
}

.edit-input {
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: inherit;
    font-family: inherit;
    background: white;
    min-width: 150px;
}

.edit-input:focus {
    outline: none;
}

/* Loading & Result */
.loading-state {
    text-align: center;
    padding: 2rem;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.invoice-result {
    margin-top: 2rem;
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.download-btn {
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-preview {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

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

/* Mobile Responsive */
@media (max-width: 1024px) {

    .steps-grid,
    .why-grid,
    .examples-grid,
    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .whatis-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container-custom {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .steps-grid,
    .why-grid,
    .examples-grid,
    .tips-grid {
        grid-template-columns: 1fr;
    }

    .generator-header {
        padding: 1rem;
    }

    .generator-body {
        padding: 1rem;
    }

    .controls-row {
        flex-direction: column;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .invoice-preview {
        padding: 1rem;
        overflow-x: scroll;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .feature-item {
        font-size: 0.7rem;
    }
}