/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #e5e5e5;
    --text-light: #a1a1aa;
    --bg-light: #1a1a1a;
    --bg-white: #0f0f0f;
    --bg-card: #1e1e1e;
    --border-color: #2a2a2a;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: var(--text-dark);
    line-height: 1.7;
    min-height: 100vh;
    padding: 2rem 1rem;
    direction: rtl;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* هدر */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo .en {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* بخش معرفی */
.intro-section {
    padding: 2.5rem 2rem;
    background: linear-gradient(to bottom, #1a1a1a, #0f0f0f);
    border-bottom: 1px solid var(--border-color);
}

.intro-section h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.intro-text {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* فرم */
.project-form {
    padding: 2rem;
}

/* بخش‌های فرم */
.form-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.section-number {
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
}

/* گروه‌های فرم */
.form-group {
    margin-bottom: 1.8rem;
}

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

.required {
    color: var(--danger-color);
    margin-right: 4px;
}

.help-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.3rem;
    margin-bottom: 0.8rem;
}

/* Input و Textarea */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-dark);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: #0a0a0a;
}

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

/* Color Picker */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.color-picker-item label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.color-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

input[type="color"] {
    width: 70px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.color-hex {
    flex: 1;
    padding: 0.6rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
}

/* Radio و Checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.2rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.radio-label:hover,
.checkbox-label:hover {
    border-color: var(--primary-color);
    background: #1a1a1a;
    transform: translateX(-4px);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + span,
.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Checkbox Grid */
.checkbox-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

/* Radio Button با پیش‌نمایش */
.radio-group-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
}

.radio-button-label {
    display: block;
    cursor: pointer;
}

.radio-button-label input[type="radio"] {
    display: none;
}

.button-preview {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.button-preview.sharp {
    border-radius: 0;
}

.button-preview.rounded {
    border-radius: var(--radius-sm);
}

.button-preview.pill {
    border-radius: var(--radius-full);
}

.radio-button-label input[type="radio"]:checked + .button-preview {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
    transform: scale(1.05);
}

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

/* UI Test Area */
.ui-test-area {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

/* Demo Buttons */
.demo-button {
    padding: 0.7rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    width: 100%;
}

.hover-color:hover {
    background: var(--accent-color);
}

.hover-smooth {
    transition: all 0.4s ease;
}

.hover-smooth:hover {
    background: var(--secondary-color);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.1);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
}

/* Font Preview */
.font-preview {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
}

.font-preview.body-preview {
    font-size: 1rem;
    font-weight: 400;
    text-align: right;
    line-height: 1.8;
}

/* دکمه ارسال */
.submit-section {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.submit-button {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-family: inherit;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.submit-button:active {
    transform: translateY(-1px);
}

.button-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.submit-button:hover .button-icon {
    transform: translateX(-5px);
}

.submit-note {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

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

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

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 3rem;
    border-radius: var(--radius-lg);
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

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

.close-modal {
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-content h2 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.modal-content p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.link-box {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
}

.link-box input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--bg-light);
    color: var(--text-dark);
}

.copy-button {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.price-estimate {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #92400e;
    border: 2px solid #fbbf24;
    margin: 1.5rem 0;
}

.modal-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    margin-top: 2rem;
}

.footer p {
    margin: 0.3rem 0;
    opacity: 0.9;
}

.footer strong {
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        border-radius: 0;
    }

    .header {
        padding: 2rem 1rem;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .intro-section {
        padding: 1.5rem 1rem;
    }

    .intro-section h2 {
        font-size: 1.4rem;
    }

    .project-form {
        padding: 1rem;
    }

    .form-section {
        padding: 1.5rem 1rem;
    }

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

    .section-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .section-header h3 {
        font-size: 1.2rem;
    }

    .color-picker-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group-grid {
        grid-template-columns: 1fr;
    }

    .radio-group-buttons {
        grid-template-columns: 1fr;
    }

    .submit-button {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        margin: 10% 1rem;
        padding: 2rem 1.5rem;
    }

    .link-box {
        flex-direction: column;
    }

    .copy-button {
        width: 100%;
    }
}

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

    .tagline {
        font-size: 0.95rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 0.95rem;
        padding: 0.8rem;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* استایل‌های بخش کد تخفیف */
.discount-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.discount-input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.discount-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.apply-discount-btn {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-discount-btn:hover {
    background: linear-gradient(135deg, #059669, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.apply-discount-btn:active {
    transform: translateY(0);
}

.apply-discount-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.discount-result {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.3s ease;
    display: none;
}

.discount-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-color);
    display: block;
}

.discount-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    display: block;
}

.discount-result.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary-color);
    display: block;
}

/* انیمیشن نتیجه تخفیف */
.discount-result {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive برای موبایل */
@media (max-width: 768px) {
    .discount-input-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .apply-discount-btn {
        width: 100%;
    }
}
