.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="range"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="range"] {
    padding: 0;
    height: 6px;
}

fieldset {
    border: none;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

legend {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.template-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.template-preview {
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-accent {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    opacity: 0.8;
}

.template-info {
    padding: 1rem;
}

.template-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.template-info p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.875rem;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #0066cc;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #0052a3;
}

.btn-small.btn-danger {
    background: #e63946;
}

.btn-small.btn-danger:hover {
    background: #d62828;
}

.template-list-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.template-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.template-list-header h4 {
    margin: 0 0 0.25rem 0;
}

.template-list-header p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

.template-list-actions {
    display: flex;
    gap: 0.5rem;
}

.template-list-params {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #666;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.palette-colors {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.palette-color {
    flex: 1;
    padding: 1rem;
    text-align: center;
    color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.palette-color span {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.preview-section {
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-section h3 {
    margin: 0;
    font-size: 1.5rem;
}

.preview-section p {
    margin: 0;
    font-size: 1rem;
}

.preview-section button {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Sections */
section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

section h2 {
    margin-bottom: 1.5rem;
    color: #0066cc;
    font-size: 1.5rem;
}

/* Contrôles */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

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

.control-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.control-group input[type="range"],
.control-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.control-group span {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #0066cc;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Boutons */
.btn-create-template,
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-create-template,
.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-create-template:hover,
.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

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

/* Export */
.export-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-export {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background: #0066cc;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export:hover {
    background: #0052a3;
}

#exportOutput {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Preview elements */
.preview-elements {
    margin-top: 1rem;
}

/* Modal overlay */
.modal {
    display: none !important;
}
