/* ===== Global Styles with Cairo Font ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    direction: rtl;
    line-height: 1.6;
}

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

/* ===== Login Screen ===== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.login-box {
    background-color: #1a1a1a;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    height: 80px;
    margin-bottom: 20px;
}

.login-box h2 {
    font-family: 'Cairo', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: 'Cairo', sans-serif;
    width: 100%;
    padding: 12px 15px;
    background-color: #0a0a0a;
    border: 2px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group label {
    font-family: 'Cairo', sans-serif;
    display: block;
    text-align: right;
    margin-bottom: 8px;
    color: #cccccc;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.login-btn {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    width: 100%;
    padding: 15px;
    background-color: #4CAF50;
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.login-hint {
    font-family: 'Cairo', sans-serif;
    margin-top: 20px;
    font-size: 14px;
    color: #999999;
}

/* ===== Admin Dashboard ===== */
.admin-header {
    background-color: #1a1a1a;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo img {
    height: 50px;
}

.logo h1 {
    font-family: 'Cairo', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #4CAF50;
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-warning {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #4CAF50;
    color: #000000;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background-color: #333333;
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #444444;
}

.btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #000000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* ===== Main Content ===== */
.admin-main {
    padding: 30px 0;
    min-height: calc(100vh - 90px);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid #333333;
}

.tab-btn {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    padding: 15px 30px;
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn:hover {
    color: #4CAF50;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-family: 'Cairo', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

/* ===== Filters ===== */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.filters select,
.filters input {
    font-family: 'Cairo', sans-serif;
    padding: 12px 15px;
    background-color: #1a1a1a;
    border: 2px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
}

.filters select {
    min-width: 200px;
}

.filters input {
    flex: 1;
}

/* ===== Table ===== */
.table-container {
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #0a0a0a;
}

.data-table th {
    font-family: 'Cairo', sans-serif;
    padding: 15px;
    text-align: right;
    color: #4CAF50;
    font-weight: 700;
    font-size: 16px;
}

.data-table td {
    font-family: 'Cairo', sans-serif;
    padding: 15px;
    border-top: 1px solid #333333;
    color: #ffffff;
}

.data-table tbody tr {
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: #222222;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    font-family: 'Cairo', sans-serif;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-edit {
    background-color: #ffc107;
    color: #000000;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
    color: #ffffff;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* ===== Products Grid (Admin) ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card-admin {
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.product-card-admin:hover {
    transform: translateY(-5px);
}

.product-card-admin img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-admin-info {
    padding: 15px;
}

.product-card-admin-name {
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.product-card-admin-price {
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 8px;
}

.product-card-admin-category {
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    color: #cccccc;
    margin-bottom: 15px;
}

.product-card-admin-actions {
    display: flex;
    gap: 10px;
}

.product-card-admin-actions button {
    flex: 1;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #1a1a1a;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    background-color: #0a0a0a;
    border-bottom: 2px solid #4CAF50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #4CAF50;
}

.close-modal {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #dc3545;
}

.modal-content form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    border: 5px solid #1a1a1a;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .tab-btn i {
        font-size: 14px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters select {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}