/* Style général */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&family=Roboto:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background: linear-gradient(135deg, #120c1a 0%, #301934 25%, #451a31 50%, #541e1e 75%, #30110d 100%);
    color: #ecf0f1;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='%23ffffff' fill-opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

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

header {
    background: linear-gradient(90deg, #301934 0%, #541e1e 100%);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    position: relative;
    z-index: 101; /* Au-dessus du panneau de prévisualisation */
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 100, 50, 0.5);
}

/* Style de la disposition principale */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.sidebar {
    width: 200px;
    background: rgba(20, 10, 30, 0.8);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 100, 50, 0.2);
}

.section-btn {
    background: linear-gradient(90deg, #ff3c00 0%, #ff7b00 100%);
    color: white;
    border: none;
    padding: 12px;
    margin: 8px auto;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 10px rgba(255, 60, 0, 0.3);
    align-self: center;
    width: 90%;
    text-align: center;
}

.section-btn:hover {
    background: linear-gradient(90deg, #ff5722 0%, #ff9800 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 60, 0, 0.5);
}

.editor {
    flex-grow: 1;
    background: rgba(30, 15, 40, 0.8);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 100, 50, 0.2);
    height: 80vh;
    overflow-y: auto;
}

/* Sections */
.section {
    margin-bottom: 20px;
}

.section h2 {
    color: #ff7b00;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 100, 50, 0.3);
    padding-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 120, 50, 0.4);
}

.hidden {
    display: none;
}

/* Formulaires et inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ff9d6f;
    text-shadow: 0 0 5px rgba(255, 100, 50, 0.3);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    background: rgba(20, 10, 30, 0.6);
    border: 1px solid rgba(255, 120, 50, 0.4);
    border-radius: 6px;
    color: #ecf0f1;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 0 5px rgba(255, 100, 0, 0.1) inset;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: rgba(255, 120, 50, 0.8);
    box-shadow: 0 0 10px rgba(255, 120, 50, 0.3);
}

.vector-inputs,
.resolution-inputs,
.color-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vector-inputs input,
.resolution-inputs input,
.color-inputs input {
    flex: 1;
}

/* Primitives et lumières */
.primitive-controls,
.light-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.primitive-controls button,
.light-controls button {
    background: linear-gradient(90deg, #ff3c00 0%, #ff7b00 100%);
    padding: 12px 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(255, 60, 0, 0.3);
    transition: all 0.3s;
}

.primitive-controls button:hover,
.light-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 60, 0, 0.5);
}

.primitive-controls select,
.light-controls select {
    background: rgba(40, 20, 60, 0.8);
    border: 1px solid rgba(255, 120, 50, 0.4);
}

.primitives-list,
.lights-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* Style pour le récapitulatif des primitives et lumières */
.recap-section {
    margin-top: 30px;
}

.recap-section h3 {
    color: #ff9d6f;
    margin-bottom: 15px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* Style pour l'éditeur de primitive ou lumière */
#primitive-editor-container,
#light-editor-container {
    background: rgba(50, 25, 75, 0.7);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 120, 50, 0.4);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.form-buttons button {
    background: linear-gradient(90deg, #ff3c00 0%, #ff7b00 100%);
    padding: 10px 20px;
    border: none;
    color: white;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(255, 60, 0, 0.3);
    cursor: pointer;
}

.form-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 60, 0, 0.5);
}

.primitive-item,
.light-item {
    background: rgba(40, 20, 60, 0.6);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 120, 50, 0.4);
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.primitive-item:hover,
.light-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(255, 100, 50, 0.3);
    border-color: rgba(255, 120, 50, 0.8);
    background: rgba(50, 25, 75, 0.7);
}

.primitive-item h3,
.light-item h3 {
    margin-bottom: 10px;
    color: #ff9d6f;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

.primitive-item p,
.light-item p {
    margin: 5px 0;
    font-size: 12px;
    color: #ecf0f1;
}

.primitive-icon,
.light-icon {
    font-size: 30px;
    margin-bottom: 10px;
    color: #ff7b00;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Panel d'aperçu */
.preview-panel {
    background: rgba(30, 15, 40, 0.85);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 100, 50, 0.2);
    position: fixed;
    right: 2.5%;
    top: 51%;
    transform: translateY(-50%);
    width: 45%;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100;
}

.preview-panel h2 {
    color: #ff7b00;
    margin-bottom: 10px;
    padding-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 120, 50, 0.4);
    text-align: center;
    display: inline-block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 100, 50, 0.3);
    margin-bottom: 15px;
}

.copy-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff7b00, #ff3c00);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(255, 60, 0, 0.3);
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.copy-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 60, 0, 0.5);
}

.copy-icon {
    font-size: 18px;
    color: white;
}

#config-preview {
    background: rgba(20, 10, 30, 0.8);
    color: #ff9d6f;
    padding: 15px;
    border-radius: 6px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    height: 60vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 100, 50, 0.3);
    box-shadow: 0 0 15px rgba(255, 60, 0, 0.15) inset, 0 0 30px rgba(255, 100, 50, 0.15);
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Panel de génération */
.generation-wrapper {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 102;
    padding: 0 20px 20px 20px;
}

.generation-panel {
    background: rgba(30, 15, 40, 0.95);
    padding: 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 100, 50, 0.2);
    border-bottom: none;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

#generate-config:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 87, 34, 0.6);
}

button {
    cursor: pointer;
    background: linear-gradient(90deg, #ff5722 0%, #ff9800 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(255, 60, 0, 0.3);
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 60, 0, 0.5);
}

#generation-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.success-message {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.error-message {
    background: rgba(231, 76, 60, 0.2);
    color: #ff5e57;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.generation-panel .form-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.generation-panel label {
    color: #ff9d6f;
    font-family: 'Orbitron', sans-serif;
    margin-right: 10px;
    text-shadow: 0 0 5px rgba(255, 100, 50, 0.3);
}

.generation-panel input[type="text"] {
    background: rgba(20, 10, 30, 0.8);
    border: 1px solid rgba(255, 120, 50, 0.4);
    color: #ecf0f1;
    padding: 10px;
    max-width: 200px;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 0 10px rgba(255, 120, 50, 0.2) inset;
}

.generation-panel input[type="text"]:focus {
    border-color: rgba(255, 120, 50, 0.8);
    box-shadow: 0 0 15px rgba(255, 120, 50, 0.3);
    outline: none;
}

.generation-panel span {
    background: rgba(40, 20, 60, 0.8);
    color: #ff9d6f;
    padding: 10px;
    border-radius: 0 6px 6px 0;
    border: 1px solid rgba(255, 120, 50, 0.4);
    border-left: none;
}

/* Styles pour les éléments récapitulatifs */
.primitive-recap-item,
.light-recap-item {
    background: rgba(40, 20, 60, 0.7);
    border: 1px solid rgba(255, 120, 50, 0.4);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.primitive-recap-item:hover,
.light-recap-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(255, 100, 50, 0.3);
    border-color: rgba(255, 120, 50, 0.8);
}

.primitive-icon,
.light-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ff7b00;
    text-shadow: 0 0 10px rgba(255, 123, 0, 0.5);
}

.primitive-recap-item h4,
.light-recap-item h4 {
    color: #ff9d6f;
    margin: 5px 0;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    text-align: center;
}

.primitive-recap-item .properties,
.light-recap-item .properties {
    margin-top: 10px;
    font-size: 12px;
    color: #ecf0f1;
    text-align: center;
}

.edit-btn,
.duplicate-btn {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s;
}

.edit-btn {
    bottom: 5px;
    right: 5px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
}

.duplicate-btn {
    bottom: 5px;
    left: 5px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
}

.edit-btn:hover,
.duplicate-btn:hover {
    transform: scale(1.1);
}

/* Ajustement pour la prévisualisation du côté droit */
.container {
    max-width: 50%;
    margin-left: 2.5%;
    margin-right: auto;
    padding: 20px 20px 40px 20px;
}

/* Styles pour le sélecteur de couleur */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 120, 50, 0.5);
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    width: 60px;
    height: 30px;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    margin-left: 15px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Styles pour le sélecteur de couleur */
.color-picker-container {
    display: flex;
    align-items: center;
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    width: 60px;
    height: 30px;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 120, 50, 0.5);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}