* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
}

.container {
    /* max-width: 1400px; */
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 2rem;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.last-update {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    color: #495057;
}

.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-indicator {
    font-weight: bold;
}

.table-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.products-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 12px;
    text-align: right;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.products-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: right;
}

.products-table tbody tr:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}

.product-name {
    font-weight: 500;
    color: #333;
    max-width: 200px;
}

.price {
    font-weight: 600;
}

.new-price {
    color: #28a745;
}

.old-price {
    color: #dc3545;
    text-decoration: line-through;
}

.discount {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 12px;
}

.installment {
    color: #17a2b8;
    font-weight: 500;
}

.end-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.end-time.expired {
    color: #dc3545;
    background: #ffe6e6;
    padding: 4px 8px;
    border-radius: 6px;
}

.end-time.active {
    color: #28a745;
    background: #e8f5e8;
    padding: 4px 8px;
    border-radius: 6px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.count {
    text-align: center;
    font-weight: 600;
}

.persian-date {
    color: #666;
    font-size: 13px;
}

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

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        padding: 10px;
    }
    
    .products-table {
        font-size: 13px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
    }
    
    .products-table {
        display: block;
        overflow-x: auto;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.column-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.column-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #667eea;
}

.column-index {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.column-name {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.header-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.column-count {
    background: #17a2b8;
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: 500;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .header-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    margin: 20px 0;
}
