/* 📦 Product Sheets - Styles Spécifiques */

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

/* =================================
   HEADER DE L'OUTIL
   ================================= */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tool-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.tool-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* =================================
   LAYOUT PRINCIPAL
   ================================= */
.product-sheets-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 600px;
}

/* =================================
   SECTION FORMULAIRE
   ================================= */
.form-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.section-content {
    padding: 2rem;
}

/* =================================
   ONGLETS
   ================================= */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    margin: -2rem -2rem 2rem -2rem;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

.tab.active {
    color: var(--primary-color);
    background: white;
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

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

/* =================================
   FORMULAIRES
   ================================= */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

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

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

/* =================================
   SECTION PRIX
   ================================= */
.price-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.price-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.discount-display {
    background: #fef3cd;
    border: 1px solid #fdbf47;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.discount-display.hidden {
    display: none;
}

/* =================================
   GESTION MÉDIAS
   ================================= */
.media-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-upload:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.media-upload.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.media-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.media-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* =================================
   SECTION APERÇU
   ================================= */
.preview-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-content {
    flex: 1;
    padding: 2rem;
    background: #f8fafc;
    overflow-y: auto;
}

.empty-preview {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 3rem 1rem;
}

/* =================================
   FICHE PRODUIT GÉNÉRÉE
   ================================= */
.product-sheet {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

.product-title {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.product-title h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 2rem;
    line-height: 1.2;
}

.product-brand {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.product-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-images {
    margin-bottom: 2rem;
}

.main-image {
    width: 100%;
    max-width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin: 0 auto 1rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-gallery {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.gallery-thumb:hover {
    border-color: var(--primary-color);
}

.price-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fafbfc;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.current-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.original-price {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 1rem;
}

.discount-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.promo-code {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: #92400e;
}

.product-section {
    margin-bottom: 2rem;
}

.product-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.product-section p {
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-list li:before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

/* =================================
   ACTIONS
   ================================= */
.actions-bar {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.export-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-btn:hover {
    background: #059669;
}

/* =================================
   LOADING STATES
   ================================= */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-spinner {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* =================================
   NOTIFICATIONS
   ================================= */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =================================
   RESPONSIVE
   ================================= */
@media (max-width: 1024px) {
    .product-sheets-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .price-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .section-content {
        padding: 1.5rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-group {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-header {
        padding: 1.5rem;
    }
    
    .section-content {
        padding: 1rem;
    }
    
    .product-sheet {
        padding: 1.5rem;
    }
    
    .product-title h1 {
        font-size: 1.5rem;
    }
    
    .current-price {
        font-size: 2rem;
    }
}