/* ============================================================
   Style pour l'Inventaire de Maquettes Plastiques
   ============================================================ */

:root {
    --primary: #2c3e50;
    --primary-light: #3498db;
    --accent: #e74c3c;
    --accent-green: #27ae60;
    --accent-orange: #f39c12;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dcdde1;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
    background: var(--primary);
    color: white;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    font-size: 1.3em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.nav-links {
    display: flex;
    gap: 5px;
    list-style: none;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

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

/* ============================================================
   HEADER / HERO
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 40px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    text-align: center;
}

.hero h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.hero p {
    opacity: 0.9;
    font-size: 1.1em;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.85em;
    margin-top: 5px;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95em;
    transition: var(--transition);
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

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

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

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

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

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8em;
}

/* ============================================================
   KITS GRID
   ============================================================ */
.kits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.kit-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.kit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-light);
}

.kit-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3em;
}

.kit-info {
    padding: 18px;
}

.kit-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.kit-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-marque {
    background: #e8f4fd;
    color: #2980b9;
}

.badge-echelle {
    background: #fef3e2;
    color: #d35400;
}

.badge-theme {
    background: #e8f8f5;
    color: #1abc9c;
}

.badge-statut {
    background: #fdedec;
    color: #e74c3c;
}

.badge-statut.en-cours {
    background: #fef9e7;
    color: #f39c12;
}

.badge-statut.termine {
    background: #eafaf1;
    color: #27ae60;
}

.kit-title {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.kit-ref {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.kit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.9em;
}

.kit-price {
    font-weight: 700;
    color: var(--accent-green);
}

.kit-quantity {
    color: var(--text-light);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination button {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    color: var(--text-light);
    font-size: 0.9em;
}

/* ============================================================
   KIT DETAIL PAGE
   ============================================================ */
.kit-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.kit-detail-header {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    padding: 30px;
}

.kit-detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: var(--text-light);
}

.kit-detail-info h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 0.8em;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item span {
    font-weight: 600;
    font-size: 1.05em;
}

.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.detail-tag {
    background: var(--primary-light);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
}

.kit-detail-actions {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
.upload-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.upload-section h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drop-zone {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 20px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(52, 152, 219, 0.05);
}

.drop-zone-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.drop-zone-text {
    color: var(--text-light);
    margin-bottom: 15px;
}

.upload-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
}

.upload-result.success {
    background: #eafaf1;
    border: 2px solid var(--accent-green);
    color: #1e8449;
}

.upload-result.error {
    background: #fdedec;
    border: 2px solid var(--accent);
    color: #922b21;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h2 {
    margin-bottom: 20px;
}

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

/* ============================================================
   FORM
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95em;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .nav-links a span {
        display: none;
    }

    .hero h1 {
        font-size: 1.6em;
    }

    .kit-detail-header {
        grid-template-columns: 1fr;
    }

    .kit-detail-image {
        height: 250px;
    }

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

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

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

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

/* ============================================================
   PAGE DÉTAIL MAQUETTE
   ============================================================ */
.kit-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.detail-photo-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-photo {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg);
}

.no-photo {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 8px;
    border: 2px dashed var(--border);
    color: var(--text-light);
}

.no-photo span {
    font-size: 3em;
    margin-bottom: 10px;
}

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

.web-photo-results {
    background: var(--bg);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.detail-info h1 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--text);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

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

.badge-marque {
    background: #e8f4fd;
    color: #2980b9;
}

.badge-echelle {
    background: #fef9e7;
    color: #d4a017;
}

.badge-theme {
    background: #eafaf1;
    color: #27ae60;
}

.badge-statut {
    background: var(--bg);
    color: var(--text-light);
}

.badge-neuf {
    background: #fdedec;
    color: #e74c3c;
}

.badge-en\ cours {
    background: #fef9e7;
    color: #f39c12;
}

.badge-termine {
    background: #eafaf1;
    color: #27ae60;
}

.detail-field {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-label {
    color: var(--text-light);
    font-size: 0.9em;
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 15px;
    font-size: 0.8em;
    color: var(--primary-light);
}

/* ============================================================
   MISC
   ============================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

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

.gap-10 {
    gap: 10px;
}
