/* ===================================== */
/* ADD PRODUCT PAGE STYLES - CRUSTHOOD  */
/* ===================================== */


.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.gallery-preview .preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}
.gallery-preview .preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-preview .remove-gallery-image {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}


:root {
    --gold-primary: #d4af37;
    --gold-light: #f4e4c1;
    --gold-dark: #b8941e;
    --dark-bg: #0a0a0a;
    --dark-secondary: #1a1a1a;
    --dark-tertiary: #2a2a2a;
    --text-primary: #f5f5f5;
    --text-secondary: #c0c0c0;
    --text-muted: #808080;
    --border-color: rgba(212, 175, 55, 0.15);
    --sidebar-width: 260px;
    --success-color: #22c55e;
    --error-color: #ef4444;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

/* Import sidebar and header styles from admin dashboard */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(10, 10, 10, 0.98));
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(212, 175, 55, 0.05);
}

.admin-logo .logo-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    margin-bottom: 0.25rem;
}

.admin-logo .logo-subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-item a .material-symbols-outlined {
    font-size: 24px;
    color: var(--gold-primary);
}

.menu-item a:hover,
.menu-item.active a {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary);
    border-left: 3px solid var(--gold-primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Main Content */
.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--dark-bg);
}

/* Header */
.admin-header {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--gold-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.header-btn-link:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* ===================================== */
/* FORM CONTENT                          */
/* ===================================== */

.form-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Alert Messages */
.alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
}

.alert .material-symbols-outlined {
    font-size: 28px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Product Form */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Form Section */
.form-section {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(20, 20, 20, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header .material-symbols-outlined {
    font-size: 32px;
    color: var(--gold-primary);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Form Label */
.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: var(--error-color);
    font-size: 1.1rem;
}

/* Form Input */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.9rem 1.25rem;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(30, 30, 30, 0.8);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
}

/* Discount Display */
.discount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.discount-display.active {
    opacity: 1;
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success-color);
}

.discount-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.discount-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-label:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-primary);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--dark-bg);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked ~ span:last-child {
    color: var(--gold-primary);
    font-weight: 600;
}

/* Color Preview */
.color-option {
    grid-column: span 1;
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    background: rgba(30, 30, 30, 0.6);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-display:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
}

.file-upload-display .material-symbols-outlined {
    font-size: 48px;
    color: var(--gold-primary);
}

.upload-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Image Preview */
.image-preview {
    display: none;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid var(--gold-primary);
}

.remove-image {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--error-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(20, 20, 20, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn .material-symbols-outlined {
    font-size: 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--dark-bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(60, 60, 60, 0.6);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ===================================== */
/* RESPONSIVE DESIGN                     */
/* ===================================== */

@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .form-content {
        padding: 1.5rem;
    }

    .form-section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 1rem 1.25rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .header-btn-link span:last-child {
        display: none;
    }

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

    .form-content {
        padding: 1.25rem;
    }

    .form-section {
        padding: 1.25rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .checkbox-label {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-content {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

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

    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .file-upload-display {
        padding: 2rem 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styles */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.5);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 10px;
}