/* ===========================================
   CLEAN ADMIN PANEL CSS
   Minimal, Professional Design
=========================================== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

/* ===== ADMIN PANEL LAYOUT ===== */
.admin-panel {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.admin-panel h1 {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 30px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #495057;
    background: #e9ecef;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
    background: white;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* ===== SECTIONS ===== */
section {
    margin-bottom: 40px;
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== PRODUCT LAYOUT ===== */
.product-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    min-height: 500px;
}

.product-list {
    width: 40%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    overflow-y: auto;
}

.edit-section {
    width: 60%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 25px;
}

/* ===== PRODUCT ITEMS ===== */
.product-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.product-item:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.product-item.out-of-stock {
    border-left: 4px solid #e74c3c;
    background: #fff8f8;
}

.product-item .product-info {
    flex: 1;
}

.product-item .product-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1rem;
}

.product-item .product-details {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.product-item .price {
    color: #27ae60;
    font-weight: 600;
    font-size: 0.95rem;
}

.product-item .out-of-stock {
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.9rem;
}

.product-item .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ===== BUTTONS ===== */
button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: #2980b9;
}

button:active {
    transform: translateY(1px);
}

button.delete {
    background: #e74c3c;
}

button.delete:hover {
    background: #c0392b;
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

button.small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.save-all-btn {
    background: #27ae60;
    padding: 12px 24px;
    font-size: 1rem;
}

.save-all-btn:hover {
    background: #219653;
}

/* ===== EDITOR ===== */
.editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.editor-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* ===== STATS ===== */
.stats-display {
    display: flex;
    gap: 30px;
    background: white;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* ===== IMAGES ===== */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-block {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background: white;
}

.image-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.image-upload {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
}

.image-label {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ===== SPECS ===== */
.specs-editor {
    background: white;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 25px;
}

.specs-editor h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.specs {
    list-style: none;
    margin: 15px 0;
}

.specs li {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.specs input {
    flex: 1;
    padding: 8px 10px;
}

/* ===== TAGS ===== */
.tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    margin: 0 5px 5px 0;
    font-weight: 500;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-processing { background: #fff3cd; color: #856404; }
.status-shipped { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* ===== FILTERS ===== */
.filters {
    background: #f8f9fa;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* ===== SEARCH ===== */
.search-box {
    position: relative;
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* ===== CUSTOMER LIST ===== */
.customer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.buyer-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    transition: border-color 0.2s;
}

.buyer-card:hover {
    border-color: #adb5bd;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.customer-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.customer-id {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.customer-info {
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.info-item i {
    color: #3498db;
    width: 16px;
}

.customer-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.customer-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.customer-stats .stat i {
    color: #3498db;
    font-size: 1.1rem;
}

.customer-stats .stat span {
    font-size: 0.85rem;
    color: #6c757d;
}

.customer-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== ORDER LIST ===== */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    transition: border-color 0.2s;
}

.order-card:hover {
    border-color: #adb5bd;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
}

.order-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.tracking-number {
    color: #6c757d;
    font-size: 0.9rem;
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.detail-item i {
    color: #3498db;
    width: 16px;
}

.order-items {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

.order-items h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.items-list .item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
}

.order-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-label {
    font-weight: 500;
    color: #495057;
}

.total-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #27ae60;
}

.order-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.status-selector {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 140px;
}

/* ===== FAQ LIST ===== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    transition: border-color 0.2s;
}

.faq-card:hover {
    border-color: #adb5bd;
}

.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.faq-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    flex: 1;
}

.faq-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.faq-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

.faq-content p {
    margin: 0;
    color: #495057;
    line-height: 1.6;
}

.faq-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== FEATURED PRODUCTS ===== */
.featured-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.control-group {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
}

.control-group h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.featured-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

.featured-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.featured-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.featured-item-info input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.featured-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
}

.featured-item-meta .price {
    color: #27ae60;
    font-weight: 500;
}

.featured-item-meta .sales {
    color: #6c757d;
}

/* ===== PREVIEW ===== */
.preview-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-top: 25px;
}

.preview-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

#featured-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    min-height: 120px;
    border: 1px solid #dee2e6;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-item small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #dee2e6;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.global-actions {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== MESSAGES ===== */
.message {
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 30px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 6px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.2rem;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* ===== LOADING ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border: 1px solid #dee2e6;
}

table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tfoot {
    background: #f8f9fa;
    font-weight: 600;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .product-layout {
        flex-direction: column;
    }
    
    .product-list,
    .edit-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .admin-panel h1 {
        padding: 15px 20px;
        font-size: 1.3rem;
    }
    
    .tabs {
        padding: 0 20px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    section {
        padding: 0;
        margin-bottom: 30px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .customer-list {
        grid-template-columns: 1fr;
    }
    
    .featured-controls {
        grid-template-columns: 1fr;
    }
    
    .order-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .order-actions {
        justify-content: flex-start;
    }
    
    .global-actions {
        padding: 15px 20px;
    }
    
    .message {
        margin: 15px 20px;
    }
}

@media (max-width: 480px) {
    .admin-panel h1 {
        font-size: 1.2rem;
        padding: 12px 15px;
    }
    
    .tabs {
        padding: 0 15px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .product-list,
    .edit-section,
    .buyer-card,
    .order-card,
    .faq-card {
        padding: 15px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .save-all-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* ===== PRINT ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .admin-panel {
        box-shadow: none;
    }
    
    .tab-content {
        display: block !important;
        padding: 0;
    }
    
    button,
    .tabs,
    .global-actions,
    .action-buttons {
        display: none !important;
    }
}