/* =================================================================== */
/* ============== فایل کامل استایل‌های پروژه خرید اشتراک ============== */
/* =================================================================== */

/* ------------------ تعریف فونت و متغیرهای رنگ ------------------ */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
    --font-family: 'Vazirmatn', sans-serif;
    --primary-color: #4a90e2; /* آبی روشن برای تاکید */
    --primary-hover-color: #357ABD;
    --bg-color: #121212; /* پس زمینه اصلی تیره */
    --surface-color: #1e1e1e; /* پس زمینه کانتینرها و فرم‌ها */
    --text-primary-color: #e0e0e0; /* رنگ متن اصلی */
    --text-secondary-color: #a0a0a0; /* رنگ متن ثانویه (لیبل‌ها) */
    --border-color: #333333;
    --error-bg-color: #4d1818;
    --error-text-color: #ffcccc;
    --success-bg-color: #1a3a1a;
    --success-text-color: #cce8cc;
    --remove-btn-color: #e94560;
    --remove-btn-hover: #c73049;
}


/* -------------------------- استایل‌های عمومی -------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary-color);
    direction: rtl;
    display: flex;
    justify-content: center;
    /* این باعث می‌شود فرم‌ها در صفحاتی با محتوای کم (مثل لاگین) در مرکز عمودی باشند */
    align-items: center; 
    min-height: 100vh;
    padding: 40px 20px;
    font-size: 16px;
}

/* برای صفحاتی که محتوای طولانی دارند (مثل صفحه خرید)، این کلاس را به body اضافه کنید */
body.scrollable {
    align-items: flex-start;
}

/* ----------------------- کانتینر اصلی فرم‌ها ----------------------- */
.container {
    background-color: var(--surface-color);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
}

/* -------------------------- استایل‌های فرم -------------------------- */
h1 {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.8rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    font-weight: 400;
}

input[type="text"],
input[type="tel"] {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary-color);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* -------------------------- استایل دکمه‌ها --------------------------- */
.button, button {
    display: inline-block;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-family);
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

.button:hover, button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

.button-add {
    background-color: #28a745;
}
.button-add:hover {
    background-color: #218838;
}

.button-remove {
    background-color: var(--remove-btn-color);
    width: auto;
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-right: auto;
    margin-top: 0;
}
.button-remove:hover {
    background-color: var(--remove-btn-hover);
}


/* ----------------------- پیام‌های خطا و موفقیت ------------------------ */
.error-message {
    background-color: var(--error-bg-color);
    color: var(--error-text-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #993333;
}

.info-message {
    background-color: var(--success-bg-color);
    color: var(--success-text-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #336633;
}

/* ------------------- استایل‌های صفحه خرید (naja_purchase.php) ------------------- */
#naja-subscriptions-container .subscription-group {
    background-color: #252525;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--primary-color);
    position: relative;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subscription-header h3 {
    color: var(--primary-color);
    font-weight: 500;
}

/* ------------------- استایل جدول سوابق خرید ------------------- */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.history-table th, .history-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
}
.history-table th {
    background-color: #2c2c2c;
    color: var(--primary-color);
    font-weight: 500;
}
.history-container h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text-primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}


/* ---------------------------------------------------- */
/* --- استایل هدر با لوگوها (نسخه نهایی و ریسپانسیو) --- */
/* ---------------------------------------------------- */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

.header-container h1 {
    margin: 0 15px; /* فاصله در حالت دسکتاپ */
    padding: 0;
    border: none;
    flex-grow: 1;
    text-align: center;
    white-space: nowrap;
    font-size: 1.8rem;
}

.header-logo {
    /* اندازه در حالت دسکتاپ */
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 5px;
    box-sizing: border-box;
    opacity: 0.9;
    
    transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}


/* ---------------------------------------------------- */
/* --- Media Query برای صفحه‌نمایش‌های کوچک (موبایل) --- */
/* ---------------------------------------------------- */
@media (max-width: 480px) {

    .container {
        padding: 30px 15px;
    }

    .header-container h1 {
        font-size: 1.4rem;
        margin: 0 10px;
    }

    .header-logo {
        width: 45px;
        height: 45px;
        padding: 3px;
    }
}
