/* ===== Admin Page Styles ===== */

:root {
    --primary-color: #2c5f4f;
    --secondary-color: #8b7355;
    --accent-color: #d4af37;
    --danger-color: #e74c3c;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --dark-color: #1a1a1a;
    --light-color: #f8f8f8;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #666;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* ===== Header ===== */
.admin-header {
    background: white;
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1a4034;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #6d5a42;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

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

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* ===== Action Bar ===== */
.action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* ===== Table Container ===== */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.search-input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    min-width: 250px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== Table ===== */
.table-responsive {
    overflow-x: auto;
}

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

.products-table thead {
    background: var(--light-color);
}

.products-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.products-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.products-table tbody tr {
    transition: var(--transition);
}

.products-table tbody tr:hover {
    background: var(--light-color);
}

.product-image-cell {
    width: 80px;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.product-name-cell {
    font-weight: 600;
    color: var(--dark-color);
}

.category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.category-목걸이 {
    background: #e3f2fd;
    color: #1976d2;
}

.category-팔찌 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.category-반지 {
    background: #e8f5e9;
    color: #388e3c;
}

.price-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
}

.table-actions-cell {
    display: flex;
    gap: 8px;
}

/* ===== Loading State ===== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.modal-small {
    max-width: 500px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 30px;
}

/* ===== Form ===== */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    color: var(--text-light);
    font-size: 0.85rem;
}

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

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

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ===== Image Preview ===== */
.image-preview {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.image-preview h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.image-preview img {
    max-width: 300px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 2000;
    transform: translateX(400px);
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.toast-content i {
    font-size: 1.3rem;
}

/* ===== Text Utilities ===== */
.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Tab Navigation ===== */
.tab-navigation {
    display: flex;
    gap: 10px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 15px 25px;
    background: var(--light-color);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

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

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #1a4034);
    color: white;
    border-color: var(--primary-color);
}

.tab-btn .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f44336;
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.tab-content {
    display: none;
}

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

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

/* ===== Icon Button ===== */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--light-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .products-table {
        font-size: 0.85rem;
    }

    .products-table th,
    .products-table td {
        padding: 10px;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 20px;
    }
}

/* ===== Scrollbar ===== */
.modal-content::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: var(--light-color);
}

.modal-content::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ===== Image Upload ===== */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-upload {
    background: var(--primary-color);
    color: white;
    border: 2px dashed var(--primary-color);
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-upload:hover {
    background: #1a4034;
    border-color: #1a4034;
    transform: translateY(-2px);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #c0392b;
}

#imagePreviewContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
}

#imagePreview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #ddd;
    box-shadow: var(--shadow);
}
