/* ═══════════════════════════════════════════
   فونت وزیرمتن
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&display=swap');

/* ═══════════════════════════════════════════
   ریست و پایه
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    color: #fff;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   کانتینر اصلی
   ═══════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════
   کارت (باکس شیشه‌ای)
   ═══════════════════════════════════════════ */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   هدر صفحه لاگین
   ═══════════════════════════════════════════ */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.header .icon:hover {
    transform: scale(1.05) rotate(5deg);
}

.header h1 {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 5px;
}

.header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 5px;
}

/* ═══════════════════════════════════════════
   نوار بالا (صفحه آپلود)
   ═══════════════════════════════════════════ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar .user-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   فرم — گروه فیلدها
   ═══════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ═══════════════════════════════════════════
   کپچا — باکس بزرگ
   ═══════════════════════════════════════════ */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-box img {
    border-radius: 12px;
    height: 65px;
    width: auto;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.captcha-box img:hover {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.captcha-box input {
    flex: 1;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 22px;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    letter-spacing: 8px;
    text-align: center;
    direction: ltr;
    outline: none;
    transition: all 0.3s ease;
}

.captcha-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    font-size: 14px;
}

.captcha-box input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #667eea;
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════
   دکمه‌ها — عمومی
   ═══════════════════════════════════════════ */
.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

/* اندازه کوچک */
.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   دکمه — انواع رنگی
   ═══════════════════════════════════════════ */

/* اصلی (بنفش) */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 17px;
    padding: 16px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* خطر (قرمز) — خروج */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
}

/* کپی (سبز) */
.btn-copy {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.btn-copy:hover {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}

/* مشاهده (آبی) */
.btn-view {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.btn-view:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

/* حذف (قرمز) */
.btn-delete {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* ═══════════════════════════════════════════
   پیام‌ها (Alert)
   ═══════════════════════════════════════════ */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    animation: fadeSlideIn 0.4s ease;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.upload-link {
    direction: ltr;
    word-break: break-all;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 200px;
    font-family: monospace, 'Vazirmatn';
    color: #a8e6cf;
    user-select: all;
}

/* ═══════════════════════════════════════════
   ناحیه آپلود (Drag & Drop)
   ═══════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.upload-zone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    border-style: solid;
    transform: scale(1.01);
}

.upload-zone .icon-upload {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.upload-zone p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.upload-zone p strong {
    color: #667eea;
}

.upload-zone small {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    line-height: 1.8;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* نوار پیشرفت */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
    display: none;
}

.progress-bar.active {
    display: block;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════
   بخش فایل‌ها
   ═══════════════════════════════════════════ */
.files-section {
    margin-top: 30px;
}

.files-section h2 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* هر آیتم فایل */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateX(-3px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.file-icon {
    font-size: 24px;
    line-height: 1;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.file-icon.img {
    background: rgba(241, 196, 15, 0.15);
}

.file-icon.zip {
    background: rgba(155, 89, 182, 0.15);
}

.file-icon.doc {
    background: rgba(52, 152, 219, 0.15);
}

.file-icon.other {
    background: rgba(255, 255, 255, 0.08);
}

.file-name {
    font-weight: 500;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}

.file-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 3px;
    direction: ltr;
    text-align: right;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-right: 10px;
}

/* ═══════════════════════════════════════════
   حالت خالی
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.icon-empty {
    font-size: 50px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.6;
}

.empty-state p {
    font-size: 15px;
}

/* ═══════════════════════════════════════════
   Toast Notification
   ═══════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(150%);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    font-weight: 500;
    font-size: 15px;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%);
}

/* ═══════════════════════════════════════════
   انیمیشن‌ها
   ═══════════════════════════════════════════ */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════
   اسکرول‌بار سفارشی
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════════
   انتخاب متن
   ═══════════════════════════════════════════ */
::selection {
    background: rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* ═══════════════════════════════════════════
   ریسپانسیو — تبلت
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .card {
        padding: 30px 25px;
        border-radius: 16px;
    }

    .header .icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
        border-radius: 18px;
    }

    .header h1 {
        font-size: 23px;
    }

    .upload-zone {
        padding: 30px 15px;
    }

    .upload-zone .icon-upload {
        font-size: 40px;
    }

    .file-item {
        padding: 12px 14px;
    }
}

/* ═══════════════════════════════════════════
   ریسپانسیو — موبایل
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .card {
        padding: 25px 18px;
        border-radius: 14px;
    }

    .header .icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        border-radius: 16px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header p {
        font-size: 13px;
    }

    /* کپچا ریسپانسیو */
    .captcha-box {
        flex-wrap: wrap;
    }

    .captcha-box img {
        height: 55px;
        width: 100%;
        flex-basis: 100%;
        order: 1;
        object-fit: contain;
        background: rgba(0, 0, 0, 0.2);
    }

    .captcha-box input {
        flex: 1;
        flex-basis: calc(100% - 62px);
        order: 2;
        font-size: 18px;
        padding: 14px;
    }

    .refresh-btn {
        flex-basis: 50px;
        order: 3;
        padding: 14px;
        font-size: 20px;
    }

    /* فرم */
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }

    /* نوار بالا */
    .topbar {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .topbar .user-info {
        font-size: 13px;
    }

    /* آپلود */
    .upload-zone {
        padding: 25px 10px;
    }

    .upload-zone .icon-upload {
        font-size: 36px;
    }

    .upload-zone p {
        font-size: 13px;
    }

    .upload-zone small {
        font-size: 11px;
    }

    /* فایل‌ها */
    .files-section h2 {
        font-size: 16px;
    }

    .file-item {
        flex-wrap: wrap;
        padding: 12px;
        gap: 10px;
    }

    .file-info {
        width: 100%;
        gap: 10px;
    }

    .file-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
        border-radius: 8px;
    }

    .file-name {
        font-size: 13px;
    }

    .file-meta {
        display: none;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
        margin-right: 0;
    }

    .btn-sm {
        padding: 7px 10px;
        font-size: 12px;
    }

    /* لینک آپلود */
    .upload-link {
        font-size: 11px;
        padding: 5px 8px;
        min-width: 100%;
    }

    /* Toast */
    .toast {
        font-size: 13px;
        padding: 12px 20px;
        bottom: 15px;
    }

    /* حالت خالی */
    .empty-state {
        padding: 30px 15px;
    }

    .icon-empty {
        font-size: 40px;
    }

    .empty-state p {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════
   ریسپانسیو — موبایل خیلی کوچک
   ═══════════════════════════════════════════ */
@media (max-width: 380px) {
    .card {
        padding: 20px 14px;
    }

    .header h1 {
        font-size: 18px;
    }

    .captcha-box input {
        font-size: 16px;
        letter-spacing: 5px;
    }

    .file-actions {
        gap: 5px;
    }

    .btn-sm {
        padding: 6px 8px;
        font-size: 11px;
    }
}
