@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-Regular.woff2)format("woff2");
    font-weight: 400;
    font-style: normal
}

@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-Medium.woff2)format("woff2");
    font-weight: 500;
    font-style: normal
}

@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-Light.woff2)format("woff2");
    font-weight: 300;
    font-style: normal
}

@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-ExtraLight.woff2)format("woff2");
    font-weight: 200;
    font-style: normal
}

@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-Bold.woff2)format("woff2");
    font-weight: 700;
    font-style: normal
}

@font-face {
    font-family: Vazir;
    src: url(../fonts/vazir/Vazirmatn-ExtraBold.woff2)format("woff2");
    font-weight: 800;
    font-style: normal
}

:root {
    /* Primary Colors */
    --cloud-dancer: #F0F0E8;
    /* خاکستری روشن کدر */
    --cloud-dancer-dark: #E8E8E0;
    /* نسخه تیره‌تر برای عمق */

    /* Accent Colors */
    --teal-primary: #0D9488;
    /* فیروزه‌ای تحول‌بخش */
    --teal-light: #14B8A6;
    /* فیروزه‌ای روشن */
    --teal-dark: #0F766E;
    /* فیروزه‌ای تیره */
    --teal-transparent: rgba(13, 148, 136, 0.1);

    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: rgba(0, 0, 0, 0.05);

    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-placeholder: #9CA3AF;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', sans-serif !important;
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    /* گرادیان پس‌زمینه با رنگ‌های کلود دنسر و فیروزه‌ای */
    background: linear-gradient(135deg, var(--cloud-dancer) 0%, #E0F2F1 25%, var(--cloud-dancer) 50%, #CCFBF1 75%, var(--cloud-dancer) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    position: relative;
}

button {
    font-family: 'Vazir', sans-serif !important;
}

/* لایه مش‌گرادیان برای عمق بصری */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(13, 148, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 240, 232, 0.8) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ANIMATIONS */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* MAIN CONTAINER - کارت شیشه‌ای */
.glass-container {
    width: 100%;
    max-width: 760px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 8px 32px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    text-align: right;
}

/* خط تزئینی بالای کارت */
.glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal-primary) 0%, var(--teal-light) 50%, var(--teal-primary) 100%);
    opacity: 0.8;
}

/* HEADER SECTION */
.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* FORM LAYOUT */
.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* INPUT GROUPS */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: right;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 400;
}

/* TEXTAREA STYLES - فیلدهای ورودی شیشه‌ای */
.glass-textarea {
    width: 100%;
    min-height: 160px;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    font-family: 'Vazir', sans-serif !important;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    resize: vertical;
    transition: all var(--transition-fast);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02), 0 2px 8px rgba(0, 0, 0, 0.02);
    text-align: right;
    direction: rtl;
    min-height: 350px;
}

.glass-textarea::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
    text-align: right;
}

.glass-textarea:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(13, 148, 136, 0.3);
}

.glass-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--teal-primary);
    box-shadow:
        0 0 0 3px rgba(13, 148, 136, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* PRIMARY BUTTON - دکمه فیروزه‌ای */
.generate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-sm);
    background: linear-gradient(135deg, var(--teal-primary) 0%, var(--teal-light) 100%);
    color: white;
    font-family: 'Vazirmatn', inherit;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
    box-shadow:
        0 4px 12px rgba(13, 148, 136, 0.3),
        0 2px 4px rgba(13, 148, 136, 0.2);
}

/* افکت درخشش دکمه */
.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: right 0.5s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(13, 148, 136, 0.4),
        0 4px 8px rgba(13, 148, 136, 0.3);
    background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal-primary) 100%);
}

.generate-btn:hover::before {
    right: 100%;
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* OUTPUT SECTION - بخش نمایش نتیجه */
.output-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.output-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.output-header::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--teal-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}

/* Output Display Box - جعبه نمایش خروجی */
.output-display {
    min-height: 200px;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.4);
    border: 1px dashed rgba(13, 148, 136, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-primary);
    position: relative;
    transition: all var(--transition-fast);
    text-align: right;
    direction: rtl;
}

.output-display:empty::before {
    content: 'پاسخ تولیدشده توسط هوش مصنوعی در اینجا نمایش داده می‌شود...';
    color: var(--text-placeholder);
    font-style: italic;
}

.output-display:focus-within {
    background: rgba(255, 255, 255, 0.6);
    border-style: solid;
    border-color: var(--teal-primary);
}

/* Placeholder state styling */
.placeholder-text {
    color: var(--text-placeholder);
    font-style: italic;
    text-align: center;
    margin: 4rem 0;
}

/* Icon styling */
.icon-pen::before {
    content: '✎';
    margin-left: 0.5rem;
    font-size: 1.2em;
}

/* RESPONSIVE DESIGN */
@media (max-width: 640px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }

    body {
        padding: var(--spacing-sm);
    }

    .glass-container {
        padding: var(--spacing-lg);
        border-radius: var(--radius-md);
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .glass-textarea {
        min-height: 140px;
    }

    .generate-btn {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .input-label {
        font-size: 0.8rem;
    }

    .generate-btn {
        font-size: 0.95rem;
    }
}

/* ACCESSIBILITY ENHANCEMENTS */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.glass-textarea:focus-visible,
.generate-btn:focus-visible {
    outline: 2px solid var(--teal-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-container {
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid var(--text-primary);
    }

    .glass-textarea {
        border: 2px solid var(--text-primary);
    }
}