/* ============================================
   استایل آرشیو قبض‌ها - نسخه کامل
   مسیر: modules/archive-bills/style.css
   Version: 1.0.0
   ============================================ */

/* ============================================
   متغیرهای رنگ - تم شیشه‌ای شاد جزیره‌ای
   ============================================ */
:root {
    --glass-bg-primary: rgba(255, 255, 255, 0.06);
    --glass-bg-secondary: rgba(255, 255, 255, 0.10);
    --glass-bg-hover: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    --ocean-blue: rgba(0, 180, 216, 0.85);
    --turquoise: rgba(0, 220, 200, 0.85);
    --golden: rgba(255, 215, 0, 0.85);
    --sunset-orange: rgba(255, 165, 0, 0.85);
    
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.70);
    --text-muted: rgba(255, 255, 255, 0.45);
    
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(0, 200, 200, 0.10);
}

/* ============================================
   صفحه آرشیو - کانتینر اصلی
   ============================================ */
.venus-archive-bills-page {
    padding: 20px 0;
    direction: rtl;
    font-family: 'Estedad', 'Vazir', 'IRANSans', sans-serif;
}

.venus-archive-bills-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   هدر
   ============================================ */
.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--glass-border);
}

.archive-header-left h1 {
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 700;
}

.archive-header-left h1 i {
    color: var(--golden);
}

.archive-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 4px 0 0;
}

.archive-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   کارت‌های آمار
   ============================================ */
.archive-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--glass-bg-primary);
    border-radius: 14px;
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glow);
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-card-total .stat-icon { background: rgba(33, 150, 243, 0.15); color: #2196F3; }
.stat-card-unpaid .stat-icon { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; }
.stat-card-paid .stat-icon { background: rgba(76, 175, 80, 0.15); color: #4CAF50; }
.stat-card-overdue .stat-icon { background: rgba(255, 152, 0, 0.15); color: #FF9800; }
.stat-card-debt .stat-icon { background: rgba(244, 67, 54, 0.15); color: #f44336; }
.stat-card-paid-amount .stat-icon { background: rgba(255, 215, 0, 0.15); color: #FFD700; }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-number.debt-amount {
    color: #ff6b6b;
}

.stat-number.golden-amount {
    color: var(--golden);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   فیلترها
   ============================================ */
.archive-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--glass-bg-primary);
    border-radius: 14px;
    margin-bottom: 16px;
    align-items: flex-end;
    border: 1px solid var(--glass-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    padding: 7px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Estedad', 'Vazir', sans-serif;
    min-width: 120px;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: rgba(0, 200, 200, 0.3);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.filter-group select option {
    background: #1a2332;
    color: #ffffff;
}

.filter-group input::placeholder {
    color: var(--text-muted);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   ابزارها
   ============================================ */
.archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: var(--glass-bg-primary);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--glass-border);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--turquoise);
}

.selected-count {
    color: var(--text-muted);
    font-size: 13px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.total-count {
    color: var(--text-muted);
    font-size: 13px;
}

.page-size-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.page-size-label select {
    padding: 4px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Estedad', 'Vazir', sans-serif;
}

/* ============================================
   جدول آرشیو
   ============================================ */
.archive-table-section {
    background: var(--glass-bg-primary);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.archive-table-section:hover {
    border-color: var(--glass-border-hover);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.archive-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
    font-size: 13px;
}

.archive-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.archive-table th {
    padding: 10px 12px;
    text-align: right;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 2px solid var(--glass-border);
}

.archive-table th input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--turquoise);
}

.archive-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 13px;
    transition: background 0.2s ease;
}

.archive-table td input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--turquoise);
}

.archive-table tbody tr {
    transition: background 0.2s ease;
}

.archive-table tbody tr:hover td {
    background: var(--glass-bg-hover);
}

.archive-table tbody tr.selected td {
    background: rgba(0, 200, 200, 0.06);
}

.archive-table .status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.archive-table .status-badge.unpaid { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.archive-table .status-badge.paid { background: rgba(76,175,80,0.15); color: #4CAF50; }
.archive-table .status-badge.overdue { background: rgba(255,152,0,0.15); color: #FF9800; }
.archive-table .status-badge.cancelled { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.archive-table .type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.archive-table .type-badge.electricity { background: rgba(255,215,0,0.15); color: #FFD700; }
.archive-table .type-badge.maintenance { background: rgba(76,175,80,0.15); color: #4CAF50; }
.archive-table .type-badge.construction { background: rgba(255,152,0,0.15); color: #FF9800; }
.archive-table .type-badge.water { background: rgba(33,150,243,0.15); color: #2196F3; }
.archive-table .type-badge.advertising { background: rgba(156,39,176,0.15); color: #9C27B0; }
.archive-table .type-badge.other { background: rgba(120,144,156,0.15); color: #78909C; }

.archive-table .debt-amount {
    color: #ff6b6b;
    font-weight: 600;
}

.archive-table .paid-amount {
    color: #4CAF50;
    font-weight: 600;
}

.action-btns {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--glass-bg-hover);
}

.action-btn.view-btn:hover { color: #4DA6FF; }
.action-btn.print-btn:hover { color: #FF9800; }

.empty-row {
    text-align: center !important;
    padding: 40px 20px !important;
    color: var(--text-muted);
}

.empty-row i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ============================================
   صفحه‌بندی
   ============================================ */
.archive-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
    margin-top: 16px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-controls span {
    color: var(--text-muted);
    font-size: 13px;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   دکمه‌ها
   ============================================ */
.venus-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Estedad', 'Vazir', sans-serif;
    color: #ffffff;
    text-decoration: none;
}

.venus-auth-btn.btn-primary {
    background: linear-gradient(135deg, var(--turquoise), var(--ocean-blue));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 20px rgba(0, 200, 200, 0.10);
}

.venus-auth-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 200, 200, 0.20);
}

.venus-auth-btn.btn-secondary {
    background: var(--glass-bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.venus-auth-btn.btn-secondary:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.venus-auth-btn.btn-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    border: 1px solid rgba(255,255,255,0.08);
}

.venus-auth-btn.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(76,175,80,0.25);
}

.venus-auth-btn.btn-warning {
    background: linear-gradient(135deg, var(--sunset-orange), #F57C00);
    border: 1px solid rgba(255,255,255,0.08);
}

.venus-auth-btn.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255,152,0,0.25);
}

.venus-auth-btn.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.venus-auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    background: rgba(0, 200, 200, 0.95);
    color: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Estedad', 'Vazir', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   واکنش‌گرایی
   ============================================ */
@media (max-width: 1200px) {
    .archive-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .archive-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .archive-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .archive-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        min-width: unset;
    }
    
    .filter-actions {
        flex-wrap: wrap;
    }
    
    .filter-actions .venus-auth-btn {
        flex: 1;
    }
    
    .archive-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .archive-header-actions {
        width: 100%;
    }
    
    .archive-header-actions .venus-auth-btn {
        flex: 1;
        justify-content: center;
    }
    
    .archive-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .toolbar-left {
        justify-content: center;
    }
    
    .toolbar-right {
        justify-content: center;
    }
    
    .archive-table {
        font-size: 12px;
        min-width: 800px;
    }
    
    .archive-table th,
    .archive-table td {
        padding: 6px 8px;
    }
    
    .archive-pagination {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .archive-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px 12px;
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
    
    .stat-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 14px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .archive-table {
        font-size: 11px;
        min-width: 650px;
    }
    
    .archive-table th,
    .archive-table td {
        padding: 4px 6px;
    }
    
    .archive-header-left h1 {
        font-size: 18px;
    }
    
    .archive-subtitle {
        font-size: 12px;
    }
    
    .archive-table-section {
        padding: 12px 14px;
    }
}

/* ============================================
   پشتیبانی از حالت تاریک و پرینت
   ============================================ */
@media (prefers-color-scheme: dark) {
    .archive-table-section {
        background: rgba(0, 0, 0, 0.20);
    }
    
    .stat-card {
        background: rgba(0, 0, 0, 0.15);
    }
    
    .archive-filters {
        background: rgba(0, 0, 0, 0.15);
    }
}

@media print {
    .venus-archive-bills-page {
        padding: 0 !important;
        background: #ffffff !important;
    }
    
    .archive-header {
        border-bottom-color: #dee2e6 !important;
    }
    
    .archive-header-left h1 {
        color: #1a2332 !important;
    }
    
    .archive-subtitle {
        color: #6c757d !important;
    }
    
    .archive-header-actions {
        display: none !important;
    }
    
    .archive-stats-grid {
        break-inside: avoid;
    }
    
    .stat-card {
        background: #f8f9fa !important;
        border-color: #e9ecef !important;
        break-inside: avoid;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .stat-number {
        color: #1a2332 !important;
    }
    
    .stat-number.debt-amount {
        color: #dc3545 !important;
    }
    
    .stat-label {
        color: #6c757d !important;
    }
    
    .archive-filters {
        display: none !important;
    }
    
    .archive-toolbar {
        display: none !important;
    }
    
    .archive-table-section {
        background: #ffffff !important;
        border: 1px solid #e9ecef !important;
        break-inside: avoid;
    }
    
    .archive-table thead {
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .archive-table th {
        color: #495057 !important;
        border-bottom-color: #dee2e6 !important;
    }
    
    .archive-table td {
        color: #212529 !important;
        border-bottom-color: #e9ecef !important;
    }
    
    .archive-table .debt-amount {
        color: #dc3545 !important;
    }
    
    .archive-table .paid-amount {
        color: #28a745 !important;
    }
    
    .archive-table .status-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .archive-table .type-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .archive-pagination {
        display: none !important;
    }
    
    .action-btns {
        display: none !important;
    }
    
    .empty-row {
        color: #6c757d !important;
    }
    
    .toast-notification {
        display: none !important;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-hover);
}