/* Admin-specific styles */

/* 顶部导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    padding: 20px 25px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.nav-item:hover {
    background-color: #34495e;
}

.nav-item.active {
    background-color: #3498db;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #fff;
}

/* 右侧用户区域 */
.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    font-size: 14px;
    color: #ecf0f1;
}

.logout-btn {
    padding: 8px 20px;
    background-color: #e74c3c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* Add Product Form */
.add-product-form {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.add-product-form h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.form-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
    font-style: italic;
}

/* Recommended Products */
.recommended-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Product Actions */
.product-actions {
    margin-bottom: 20px;
}

/* Materials Section */
.materials-section {
    margin-top: 15px;
}

.materials-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.materials-header span {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    white-space: nowrap;
}

.materials-library-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    min-width: 150px;
}

/* Form table inputs */
.form-input-small {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    background-color: white;
}

/* Size display (non-editable) */
.size-display {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    font-weight: 500;
    cursor: not-allowed;
}

/* Editable inputs */
.editable-input {
    background-color: #fff;
    border-color: #80bdff;
}

.editable-input:focus {
    background-color: #fff;
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Table action buttons in cells */
.form-table td:last-child {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Section action bar used in many config sections */
.section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
}

.section-actions select {
    min-width: 200px;
}

.save-success-message {
    background-color: #e6ffed;
    border: 1px solid #b9f2c8;
    color: #1b7f3a;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* User Management Styles */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: #3498db;
}

.no-avatar {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* User Type Badges */
.type-admin {
    background-color: #3498db;
    color: white;
}

.type-user {
    background-color: #2ecc71;
    color: white;
}

.type-viewer {
    background-color: #f39c12;
    color: white;
}

/* Avatar Preview */
.avatar-preview {
    text-align: center;
    margin: 20px 0;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-processing {
    background-color: #3498db;
    color: white;
}

.status-shipped {
    background-color: #2ecc71;
    color: white;
}

.status-delivered {
    background-color: #27ae60;
    color: white;
}

.status-pending {
    background-color: #f39c12;
    color: white;
}

/* ===== FIXED PASSWORD DISPLAY - SIMPLE FIX ===== */
.password-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.password-reveal {
    font-family: monospace;
    color: #e74c3c;
    font-weight: bold;
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    min-width: 100px;
    display: inline-block;
    word-break: break-word;
    max-width: 120px;
}

/* Adjust table column widths */
.data-table th:nth-child(1) { width: 20%; }
.data-table th:nth-child(2) { width: 30%; }
.data-table th:nth-child(3) { width: 10%; }
.data-table th:nth-child(4) { width: 10%; }
.data-table th:nth-child(5) { width: 10%; }
.data-table th:nth-child(6) { width: 15%; }
.data-table th:nth-child(7) { width: 15%; }
.data-table th:nth-child(8) { width: 10%; }

/* .data-table td:nth-child(2) {
    min-width: 220px;
    max-width: 280px;
} */

.data-table td:nth-child(1) {
    padding-right: 5px;
    min-width: 120px;
}

.data-table td:nth-child(3) {
    text-align: center;
    min-width: 80px;
}

.data-table td:first-child {
    padding-right: 0;
}

.data-table td:nth-child(2) {
    padding-left: 5px;
}

.data-table td {
    padding: 12px 5px;
}

/* Product image styles */
.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Enhanced table styles for products */
.data-table th:nth-child(1) { width: 80px; }
.data-table th:nth-child(2) { width: 220px; }
.data-table th:nth-child(3) { width: 80px; }
.data-table th:nth-child(4) { width: 100px; }
.data-table th:nth-child(5) { width: 160px; }
.data-table th:nth-child(6) { width: 200px; }
.data-table th:nth-child(7) { width: 140px; }
.data-table th:nth-child(8) { width: 180px; }

/* Product modal row styling */
.modal-content .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.description-box {
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-line;
    line-height: 1.5;
}

/* Navigation improvements */
.nav-icon {
    margin-right: 8px;
    font-size: 16px;
}

.nav-label {
    font-size: 14px;
}

/* User section improvements */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-status {
    font-size: 11px;
    color: #2ecc71;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background-color: #e74c3c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.logout-icon {
    font-size: 14px;
}

.logout-text {
    font-size: 13px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* Responsive design */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 15px;
    }
    
    .nav-menu {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        flex-wrap: nowrap;
        max-width: calc(100vw - 200px);
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .nav-item {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 20px 15px;
    }
    
    .nav-label {
        display: none;
    }
    
    .nav-icon {
        margin-right: 0;
        font-size: 18px;
    }
    
    .logout-text {
        display: none;
    }
    
    .logout-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 10px;
        height: 56px;
    }
    
    .nav-menu {
        max-width: calc(100vw - 120px);
        gap: 0;
        margin-right: 10px;
    }
    
    .nav-item {
        padding: 18px 12px;
        font-size: 14px;
    }
    
    .user-section {
        gap: 10px;
        flex-shrink: 0;
    }
    
    .user-details {
        display: none;
    }
    
    .username {
        display: none;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 8px;
        height: 52px;
    }
    
    .nav-menu {
        max-width: calc(100vw - 80px);
    }
    
    .nav-item {
        padding: 16px 10px;
        font-size: 13px;
        min-width: 60px;
        text-align: center;
    }
    
    .logout-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}