/* CSS Variables */
:root {
    --primary-color: #2E7D32;
    /* Green 800 */
    --primary-hover: #1B5E20;
    --secondary-color: #81C784;
    /* Green 300 */
    --accent-color: #FFD54F;
    /* Amber 200 */
    --text-color: #333333;
    --light-text: #666666;
    --bg-color: #F9F9F9;
    --card-bg: #FFFFFF;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    font-weight: 500;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 30px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Demo Section */
.demo-section {
    padding: 80px 0;
    background: #f0f7f0;
}

.demo-section h2 {
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 40px;
}

.demo-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* File Upload */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f1f8e9;
}

.upload-icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

.upload-content p {
    margin: 5px 0;
}

.upload-content span {
    color: var(--primary-color);
    font-weight: 600;
}

.small {
    font-size: 0.8rem;
    color: #999;
}

#previewContainer {
    position: relative;
    width: 100%;
    margin-top: 20px;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
}

.form-actions {
    margin-top: 20px;
}

/* Result Area */
.result-area {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.loader {
    text-align: center;
    padding: 20px;
}

/* Examples Section */
.examples-section {
    padding: 80px 0;
    background: #f9f9f9;
}

.examples-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    color: #2c3e50;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.example-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
}

.example-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.example-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.badge-before {
    left: 10px;
    background: rgba(231, 76, 60, 0.9);
    /* Red */
}

.badge-after {
    right: 10px;
    background: rgba(46, 204, 113, 0.9);
    /* Green */
}

.example-content {
    padding: 25px;
}

.example-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: #333;
    border-bottom: 2px solid #eef2f5;
    padding-bottom: 10px;
}

.example-content p {
    margin: 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.example-content .problem {
    color: #c0392b;
}

.example-content .solution {
    color: #27ae60;
}

.example-content .result {
    font-weight: 600;
    margin-top: 15px;
    color: #2c3e50;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.result-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.error-content {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer p {
    color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav {
        display: none;
        /* Simple mobile hide for now, or add burger menu later */
    }

    .hero-buttons {
        flex-direction: column;
    }

    .examples-section {
        padding: 40px 0;
    }
}

.form-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-check-input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}

.form-check-label a {
    color: var(--primary-color);
    text-decoration: underline;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}