* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Zain', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;   
}

html {
    background-color: #eee;
    color: #333;
    direction: rtl;
    --main-color: #3F57B3;
    --secondary-color: #263161;
}

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

#headerDiv {
    background-color: var(--main-color);
    color: white;
    padding: 15px;
    font-size: 24px;
    font-weight: bold;
    height: 12vh;
}

#headerDiv .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#headerDiv .container .header-nav-bar ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    align-items: center;
    font-size: 20px;
}

#headerDiv .container .header-nav-bar ul li {
    padding: 10px   ;
}

#headerDiv .container .header-nav-bar ul li i {
    margin-right: 5px;
}

#headerDiv .container .header-nav-bar li:hover {
    cursor: pointer;
    background-color: #96a4db;
}

#headerDiv .container .logoDiv {
    display: flex;
    justify-content: center;
    align-items: center;   
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white; 
}

#headerDiv .container .logoDiv img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

#mainDiv {
    display: flex;
    justify-content: center;
    align-items: center;    
    min-height: 76vh;
}

#footerDiv {
    text-align: center;
    padding: 10px;
    background-color: var(--main-color);
    color: white;
    height: 12vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

#loginContainer {
    width: 90%;
    text-align: center;
    border: 2px solid var(--main-color);
    padding: 20px;
    border-radius: 10px;
    background-color: white;
    max-width: 500px;
    margin: 50px auto;
}

#loginContainer h2 {
    margin-bottom: 20px;
    color: var(--main-color);
}

#loginContainer label {
    display: block;
    margin: 10px auto;
    font-size: 18px;
}

#loginContainer input[type="text"],
#loginContainer input[type="password"] {
    display: block;
    width: 80%;
    padding: 10px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    outline-color: var(--main-color);
}

#loginContainer button {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 15px;
}

.spinner {
    text-align: center;
    color: var(--main-color);
    font-size: 18px;
}

.spinner .bounce {
    margin: 0 auto 15px auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #ddd;
    border-top-color: var(--main-color);
    animation: spin 1s infinite linear;
}

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

#alertOverlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#alertBox {
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    width: 85%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.alertIcon {
    font-size: 50px;
    margin-bottom: 10px;
    color: var(--main-color);
}

#alertBox h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    margin: 20px 0;
}

#alertBox p {
    color: #555;
    font-size: 17px;
    margin: 20px 0;
}

#alertOk {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    cursor: pointer;
    font-size: 17px;
    transition: background 0.2s;
}

#alertOk:hover {
    background: #0056b3;
}

.pop-in {
    animation: popIn 0.3s ease;
}

.pop-out {
    animation: popOut 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}


@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes popOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.8); opacity: 0; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.dashboard-container {
    width: 100%;
    align-self: start;
}

.dashboard-container .container .cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dashboard-container .container h3 {
    color: var(--secondary-color);
    font-size: 22px;
    margin: 15px 0;
    text-align: center;
}

.dashboard-container .container .user-info-container {
    width: 100%;
    max-width: 400px;
    
    background-image: linear-gradient(to right, #96a4db ,var(--main-color));
    color: white;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 18px;
}

.dashboard-container .container .user-info-container button {
    background-color: white;
    color: var(--main-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    #headerDiv .container {
        padding: 0;
    }
    .dashboard-container .container .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .dashboard-container .container .cards-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background-color: white;
    font-size: 20px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.card i {
    display: flex;
    align-items: center;
    font-size: 40px;
    color: var(--main-color);
}

.dashboard-container .container .card h3 {
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 10px;
    text-align: right;
}

.dashboard-container .container .card p {
    color: rgb(106, 104, 104);
    font-size: 15px;
}

.card:hover {
    cursor: pointer;
    transform: scale(1.1);
}

.card:active {
    background-color: #eee;
}

@media (min-width: 1200px) {
    .dashboard-container .container .cards-container {
        gap: 40px;
    }
    .card h3 {
        font-size: 22px;
        color: var(--secondary-color);
        margin-bottom: 10px;
    }

    .card p {
        color: rgb(106, 104, 104);
        font-size: 17px;
    }
}

.sellers-view {
    width: 100%;
    align-self: start;
}

.sellers-view .container {
    width: 100%;
}

.sellers-view .container #addSeller {
    background-color: var(--main-color);
    color: white;
    display: block;
    width: 100%;
    max-width: 800px;
    padding: 12px;
    border: none;
    border-radius: 5px;
    margin: 20px auto;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.sellers-container {
    background-color: #c6ddfc;
    padding: 15px;
    border-radius: 10px;
    max-width: 800px;
    margin: auto;
    min-height: 60vh;
}

.sellers-container .sellerCard {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.179);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sellers-container .sellerCard h4 {
    margin: 0 0 12px 0;
    color: #2e2929;
    font-size: 22px;
}

.sellers-container .sellerCard .actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.sellers-container .sellerCard .actions button {
    width: 100%;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

.deactivateButton {
    background-color: orange;
    color: rgb(48, 37, 37);
}

.activateButton {
    background-color: green;
    color: white;
}

.editButton {
    background-color: rgb(97, 88, 219);
    color: white;
}

.deleteButton {
    background-color: red;
    color: white;
}

@media (min-width: 1200px) {
    .sellers-container .sellerCard {
        padding: 30px;
        flex-direction: row;
        justify-content: space-between;
    }

    .sellers-container .sellerCard h4 {
        margin: 0;
    }

    .sellers-container .sellerCard .actions {
        width: 50%;
    }

    .sellers-view .container #addSeller {
        padding: 17px;
        font-size: 18px;
    }
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

#sellerModalMessages {
    margin: 15px 0;
    font-size: 16px;
    text-align: center;
}

#sellerModalMessages .error {
    color: red;
}

#sellerModalMessages .success {
    color: green;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

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

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.dialoge-spinner {
    display: none;
    width: 20px;
    height: 20px;
    margin: 0 auto;
    border: 3px solid #ddd;
    border-top-color: var(--main-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

/* Seller Dashboard */


/* Search and Add Section */
.controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-add-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.add-btn {
    background: #2ed573;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.add-btn:hover {
    background: #26d467;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f1f2f6;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-btn:hover {
    background: #667eea;
    color: white;
}

.filter-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    margin-right: 5px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-card.inactive {
    background: #000000;
}

.product-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.status-active {
    background: #2ed573;
    color: white;
}

.status-inactive {
    background: #ff4757;
    color: white;
}

.review-badge {
    display: inline-block;
    margin-top: 5px;
    margin-right: 10px;
    padding: 5px 10px;
    background: #ffa502;
    color: white;
    font-size: 15px;
    border-radius: 10px;
    font-weight: 500;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.product-title.inactive {
    color: white;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #2ed573;
    margin-bottom: 10px;
}

.product-details {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-details.inactive {
    color: white;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.product-stock {
    background: #f1f2f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
}

.product-seller {
    background: #3742fa;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.approve-btn {
    background: #2ed573;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    grid-column: 1 / -1;
}

.edit-btn {
    background: #5352ed;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    grid-column: 1 / -1;
}

.toggle-btn {
    background: #ffa502;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.approve-btn:hover {
    background: #27c76f;
}

.edit-btn:hover {
    background: #4741d8;
}

.toggle-btn:hover {
    background: #ff7f00;
}

.delete-btn:hover {
    background: #ff3742;
}

/* Image Upload */
.image-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.image-upload:hover {
    border-color: #667eea;
}

.image-upload.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    margin-bottom: 10px;
}

.file-input {
    display: none;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 15px;
    border-radius: 8px;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Error Message */
.error-message {
    background: #ff4757;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.success-message {
    background: #2ed573;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #333;
}

.no-products-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.countries {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.countries .country-label {
    display: inline-block;  
}

.countries input {
    width: auto;
    margin: 0;
    vertical-align: middle;
    margin-left: 5px;
}