/* admin.css - Styles pour l'interface d'administration inspirée de ninjastore */
:root {
    --admin-bg: #f9fafb;
    --admin-sidebar: #ffffff;
    --admin-text: #1f2937;
    --admin-text-muted: #6b7280;
    --admin-border: #e5e7eb;
    --admin-primary: #000000;
    --admin-danger: #ef4444;
    --admin-success: #10b981;
}

body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--admin-border);
}

.back-link {
    color: var(--admin-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 10px;
}

.back-link:hover {
    color: var(--admin-text);
}

.sidebar h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    margin: 0;
}

.nav-group {
    padding: 15px 0;
    border-bottom: 1px solid var(--admin-border);
}

.nav-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--admin-text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0 20px;
    margin-bottom: 10px;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: var(--admin-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: #f3f4f6;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

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

.header-actions h1 {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    font-size: 1.8rem;
}

/* Form Styles */
.form-section {
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 8px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--admin-text);
    background: #ffffff;
    transition: border-color 0.2s;
}

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

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

.help-text {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-top: 5px;
}

/* Images Upload Section */
.file-input-container {
    border: 1px dashed var(--admin-border);
    border-radius: 8px;
    padding: 20px;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-file {
    border: 1px solid var(--admin-text);
    padding: 6px 12px;
    background: #efefef;
    color: black;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-file:hover {
    background: #e0e0e0;
}

.images-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.image-preview {
    width: 120px;
    height: 120px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.image-preview img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-preview.main {
    border: 2px solid black;
}

.image-preview.main::after {
    content: 'Principale';
    position: absolute;
    bottom: -10px;
    background: black;
    color: white;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 12px;
}

.img-btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    color: var(--admin-danger);
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 10;
}

.img-btn-remove:hover {
    background: #fee2e2;
}

.img-btn-star {
    position: absolute;
    top: -8px;
    left: -8px;
    background: white;
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 10;
}

.image-preview.main .img-btn-star {
    background: black;
    color: white;
    border-color: black;
}

.img-btn-star:hover:not(.main .img-btn-star) {
    background: #f3f4f6;
    color: black;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #333;
}

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

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

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

.btn-secondary:hover {
    background: #f9fafb;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-bottom: 40px;
}

/* Product List Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

th {
    color: var(--admin-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.edit-btn {
    color: var(--admin-primary);
    text-decoration: underline;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

#product-form-view {
    display: none;
}
