/* فایل: style.css - نسخه حرفه‌ای */

:root {
    /* پالت رنگی جدید و زنده‌تر */
    --primary-start: #6366f1; /* Indigo */
    --primary-end: #8b5cf6;   /* Violet */
    --accent: #4f46e5;
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --surface: rgba(255, 255, 255, 0.95); /* شفافیت جزئی */
    --text-main: #111827;
    --text-sub: #6b7280;
    --border: #e2e8f0;
    --radius: 20px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    /* بک‌گراند انیمیشن‌دار */
    background: linear-gradient(-45deg, #4facfe, #00f2fe, #43e97b, #38f9d7);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* انیمیشن پس‌زمینه */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-wrapper {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

/* کارت اصلی با افکت شیشه‌ای محو */
.card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* انیمیشن ورود کارت */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* هدر کارت */
.header h2 {
    margin: 12px 0 8px 0;
    color: var(--text-main);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* آیکون بالای صفحه */
.icon-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    color: var(--accent);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.card:hover .icon-circle {
    transform: rotate(0deg) scale(1.1);
}

.icon-circle svg {
    width: 32px;
    height: 32px;
}

/* ناحیه آپلود پیشرفته */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 18px;
    padding: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.upload-area:hover, .upload-area.active {
    border-color: var(--accent);
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.15);
}

/* محتویات ناحیه آپلود */
.content-default .cloud-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    filter: grayscale(100%);
    opacity: 0.4;
    transition: all 0.3s;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.upload-area:hover .cloud-icon {
    filter: grayscale(0%);
    opacity: 1;
}

.content-default p {
    margin: 5px 0 15px 0;
    color: var(--text-sub);
    font-weight: 500;
}

.btn-select {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 12px;
    color: var(--accent);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-select:hover {
    border-color: var(--accent);
    color: white;
    background: var(--accent);
}

/* استایل پیش‌نمایش تصویر */
.content-preview {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px; /* فاصله داخلی برای قاب عکس */
    box-sizing: border-box;
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover; /* حفظ تناسب */
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.btn-remove {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.85);
    color: #ef4444;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-remove:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1) rotate(90deg);
}

/* دکمه ارسال اصلی - زیبا و برجسته */
.btn-primary {
    width: 100%;
    margin-top: 1.5rem;
    padding: 16px;
    border: none;
    border-radius: 16px;
    /* گرادینت دکمه */
    background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
    color: white;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -10px var(--primary-start);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px var(--primary-start);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* استایل لودر (اسپینر) */
.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.8s ease-in-out infinite;
    position: absolute;
}

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

/* پیام‌های وضعیت با استایل حباب‌گونه */
.status-msg {
    margin-top: 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(5px);
}

.status-msg.success, .status-msg.error {
    opacity: 1;
    transform: translateY(0);
}

.success {
    background: #dcfce7;
    color: #15803d;
}

.error {
    background: #fee2e2;
    color: #b91c1c;
}