/**
 * Sale Club Common Styles
 * استایل‌های مشترک برای تمام صفحات
 */

/* Vazir Font - Using @font-face instead of @import to avoid CSP issues */
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazir/v33/7cHtv4_NjTtpDfw0xJmpoyHmWw.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazir/v33/7cHtv4_NjTtpDfw0xJmpoyHmWw.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazir/v33/7cHtv4_NjTtpDfw0xJmpoyHmWw.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazir/v33/7cHtv4_NjTtpDfw0xJmpoyHmWw.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Vazir';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazir/v33/7cHtv4_NjTtpDfw0xJmpoyHmWw.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}

/* Root Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #f093fb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --text-primary: #2d3748;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.35);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s ease;
}

/* Base Styles */
.sale-club-container,
.sale-club-wallet-container,
.sale-club-dashboard,
.sale-club-settlement-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

/* Typography - Optimized Font Sizes */
.sale-club-container h1 {
    font-family: 'Vazir', sans-serif;
    font-size: 25px; /* Maximum 25px */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.sale-club-container h2 {
    font-family: 'Vazir', sans-serif;
    font-size: 22px; /* Proportional */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.sale-club-container h3 {
    font-family: 'Vazir', sans-serif;
    font-size: 19px; /* Proportional */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.sale-club-container h4 {
    font-family: 'Vazir', sans-serif;
    font-size: 17px; /* Proportional */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.sale-club-container p {
    font-family: 'Vazir', sans-serif;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Common Page Header */
.sale-club-page-header-common {
    background: var(--primary-gradient);
    color: white;
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.sale-club-page-header-common::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: rotate 25s linear infinite;
}

.header-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

/* Right Side: Page Title & Subtitle */
.header-right {
    flex: 1;
    min-width: 200px;
}

.header-right .page-title {
    font-family: 'Vazir', sans-serif;
    font-size: 25px; /* Maximum 25px as requested */
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.4;
}

.header-right .page-subtitle {
    font-family: 'Vazir', sans-serif;
    font-size: 16px; /* Proportional to h1 */
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

/* Left Side: User Info */
.header-left {
    flex-shrink: 0;
}

.user-info {
    text-align: left;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
}

.user-name,
.user-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.user-name:last-child,
.user-mobile:last-child {
    margin-bottom: 0;
}

.user-icon,
.mobile-icon {
    font-size: 18px;
    opacity: 0.9;
}

.name-text,
.mobile-text {
    font-family: 'Vazir', sans-serif;
    font-size: 15px;
    font-weight: 500;
}

/* Legacy Headers - Keep for backward compatibility but use optimized sizes */
.sale-club-page-header,
.dashboard-header,
.wallet-header {
    background: var(--primary-gradient);
    color: white;
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.sale-club-page-header::before,
.dashboard-header::before,
.wallet-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: rotate 25s linear infinite;
}

.sale-club-page-header h1,
.sale-club-page-header h2,
.dashboard-header h1,
.dashboard-header h2,
.wallet-header h1,
.wallet-header h2 {
    font-family: 'Vazir', sans-serif;
    font-size: 25px; /* Maximum 25px */
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

.sale-club-page-header p,
.dashboard-welcome,
.wallet-welcome {
    font-family: 'Vazir', sans-serif;
    font-size: 16px; /* Proportional */
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* Cards */
.sale-club-card,
.wallet-summary-card,
.stat-card,
.page-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sale-club-card::before,
.wallet-summary-card::before,
.stat-card::before,
.page-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transition: height 0.3s ease;
}

.sale-club-card:hover,
.wallet-summary-card:hover,
.stat-card:hover,
.page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
}

.sale-club-card:hover::before,
.wallet-summary-card:hover::before,
.stat-card:hover::before,
.page-card:hover::before {
    height: 6px;
}

/* Buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-warning,
.btn-danger {
    font-family: 'Vazir', sans-serif;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px; /* Optimized - proportional to h1 */
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(100, 116, 139, 0.4);
    text-decoration: none;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    text-decoration: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
    text-decoration: none;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Forms */
.sale-club-form,
.form-group {
    margin-bottom: 25px;
}

.form-label,
label {
    font-family: 'Vazir', sans-serif;
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1em;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
    font-family: 'Vazir', sans-serif;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px; /* Optimized - proportional */
    transition: var(--transition);
    background: white;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tables */
.sale-club-table,
table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Vazir', sans-serif;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sale-club-table thead,
table thead {
    background: var(--primary-gradient);
}

.sale-club-table th,
table th {
    color: white;
    padding: 15px;
    text-align: right;
    font-weight: 600;
    font-size: 0.95em;
}

.sale-club-table td,
table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.sale-club-table tr:hover td,
table tr:hover td {
    background: var(--bg-light);
}

/* Alerts & Notices */
.sale-club-notice,
.alert {
    font-family: 'Vazir', sans-serif;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-right: 4px solid;
}

.sale-club-notice-success,
.alert-success {
    background: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.sale-club-notice-warning,
.alert-warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.sale-club-notice-danger,
.alert-danger {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.sale-club-notice-info,
.alert-info {
    background: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

/* Badges */
.badge,
.status-badge {
    font-family: 'Vazir', sans-serif;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px; /* Optimized - proportional */
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

/* Animations */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sale-club-container,
    .sale-club-wallet-container,
    .sale-club-dashboard {
        padding: 15px;
    }
    
    .sale-club-page-header-common,
    .sale-club-page-header,
    .dashboard-header,
    .wallet-header {
        padding: 20px 15px;
    }
    
    .header-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .header-right,
    .header-left {
        width: 100%;
    }
    
    .user-info {
        width: 100%;
        text-align: right;
    }
    
    .header-right .page-title,
    .sale-club-page-header h1,
    .sale-club-page-header h2,
    .dashboard-header h1,
    .wallet-header h1 {
        font-size: 22px; /* Slightly smaller on mobile */
    }
    
    .header-right .page-subtitle,
    .sale-club-page-header p,
    .dashboard-welcome,
    .wallet-welcome {
        font-size: 15px;
    }
    
    .sale-club-container h1 {
        font-size: 22px;
    }
    
    .sale-club-container h2 {
        font-size: 20px;
    }
    
    .sale-club-container h3 {
        font-size: 18px;
    }
    
    .sale-club-container h4 {
        font-size: 16px;
    }
    
    .sale-club-card,
    .wallet-summary-card {
        padding: 20px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

