/* Variables CSS pour le thème rouge et noir */
:root {
    --primary-red: #dc2626;
    --dark-red: #991b1b;
    --light-red: #ef4444;
    --primary-black: #0f0f0f;
    --dark-gray: #1f1f1f;
    --medium-gray: #2d2d2d;
    --light-gray: #404040;
    --white: #ffffff;
    --text-light: #f5f5f5;
    --border-color: #404040;
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --shadow-red: rgba(220, 38, 38, 0.3);
    --gradient-red: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    --gradient-dark: linear-gradient(135deg, var(--primary-black), var(--dark-gray));
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
    background: var(--gradient-red);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px var(--shadow-dark);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Layout principal */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    min-height: 800px;
}

/* Colonne de gauche */
.left-column {
    background: var(--dark-gray);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    border: 1px solid var(--border-color);
}

.tools-panel h2 {
    color: var(--primary-red);
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 10px;
}

.tool-section {
    margin-bottom: 20px;
}

.tool-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px var(--shadow-red);
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-red);
    background: var(--light-red);
}

.tool-btn:active {
    transform: translateY(0);
}

.tool-btn i {
    font-size: 1.2rem;
}

/* Zone de téléchargement */
.upload-area {
    display: none;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

.upload-area.active {
    display: block;
}

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

.drop-zone {
    border: 2px dashed var(--primary-red);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: var(--medium-gray);
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--light-red);
    background: var(--light-gray);
}

.drop-zone.dragover {
    border-color: var(--light-red);
    background: var(--light-gray);
    transform: scale(1.02);
}

.drop-zone i {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 10px;
    display: block;
}

#photoInput {
    display: none;
}

/* Contrôles de texte */
.text-controls {
    display: none;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

.text-controls.active {
    display: block;
}

.text-controls input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

.text-options {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.text-options select {
    padding: 8px;
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
}

.text-options input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.format-btn {
    width: 40px;
    height: 40px;
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.format-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.add-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: var(--light-red);
    transform: translateY(-1px);
}

/* Panneaux de bibliothèque */
.library-panel, .clipart-panel, .emoticon-panel, .cart-panel {
    display: none;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

.library-panel.active, .clipart-panel.active, .emoticon-panel.active, .cart-panel.active {
    display: block;
}

.library-tabs, .clipart-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: var(--light-gray);
}

.tab-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.library-content, .clipart-content, .emoticon-content {
    max-height: 300px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px;
    background: var(--medium-gray);
    border-radius: 8px;
}

.library-item, .clipart-item, .emoticon-item {
    aspect-ratio: 1;
    background: var(--light-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.library-item:hover, .clipart-item:hover, .emoticon-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px var(--shadow-red);
}

.library-item img, .clipart-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emoticon-item {
    font-size: 2rem;
}

/* Panier */
.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--white);
    color: var(--primary-red);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--medium-gray);
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-remove {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-item-remove:hover {
    background: var(--light-red);
}

.order-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-red);
}

/* Colonne de droite */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Canvas */
.canvas-container {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    position: relative;
    overflow: hidden;
}

#designCanvas {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: #f8f9fa;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
}

.canvas-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
    border-radius: 10px;
}

/* Liste des éléments */
.elements-list {
    background: var(--dark-gray);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow-dark);
    border: 1px solid var(--border-color);
}

.elements-list h3 {
    color: var(--primary-red);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 10px;
}

.elements-container {
    max-height: 300px;
    overflow-y: auto;
}

.no-elements {
    text-align: center;
    color: var(--light-gray);
    font-style: italic;
    padding: 20px;
}

.element-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--medium-gray);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.element-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.element-preview {
    width: 40px;
    height: 40px;
    background: var(--light-gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.element-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.element-info {
    flex: 1;
}

.element-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.element-type {
    font-size: 0.8rem;
    color: var(--light-gray);
}

.element-controls {
    display: flex;
    gap: 5px;
}

.element-control-btn {
    width: 30px;
    height: 30px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.element-control-btn:hover {
    background: var(--light-red);
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--dark-gray);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px var(--shadow-dark);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--light-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-red);
}

.modal-content h2 {
    color: var(--primary-red);
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 15px;
}

/* Formulaire */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-light);
}

.form-group input,
.form-group select {
    padding: 12px;
    background: var(--medium-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.form-group input[readonly] {
    background: var(--light-gray);
    cursor: not-allowed;
}

/* Section paiement */
.payment-section {
    margin: 30px 0;
    padding: 20px;
    background: var(--medium-gray);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.payment-section h3 {
    color: var(--primary-red);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.payment-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.payment-option:hover {
    background: var(--border-color);
}

.payment-option input[type="radio"] {
    margin: 0;
}

.payment-option i {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.card-form {
    animation: slideDown 0.3s ease;
}

.order-designs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px;
    background: var(--medium-gray);
    border-radius: 8px;
    min-height: 120px;
}

.order-design-item {
    aspect-ratio: 1;
    background: var(--light-gray);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.order-design-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-red);
}

.checkbox-label a {
    color: var(--primary-red);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--shadow-red);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Scrollbars personnalisées */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light-red);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 350px 1fr;
    }
    
    #designCanvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-column {
        order: 2;
    }
    
    .right-column {
        order: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
}

/* Animations supplémentaires */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bounce {
    animation: bounce 1s;
}

/* États de chargement */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

