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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 20px 0;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.header-logo {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}



/* Main Content */
.main-content {
    padding-bottom: 60px;
}

.form-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.form-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-subtitle {
    color: #888;
    font-size: 16px;
    margin-bottom: 40px;
}

/* Form Elements */
.form-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-input::placeholder {
    color: #666;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.radio-item:hover {
    background: #2a2a2a;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #444;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.radio-item input[type="radio"]:checked + .radio-custom {
    border-color: #007bff;
    background: #007bff;
}

.radio-item input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.radio-label {
    font-weight: 500;
}

/* Backup Elements Section */
.backup-elements-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #333;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.backup-elements-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.element-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.element-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.element-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.element-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #444;
    color: #fff;
}

.copy-element:hover {
    background: #28a745;
    color: #fff;
}

.remove-element:hover {
    background: #dc3545;
    color: #fff;
}

.element-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}


/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

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

.btn-secondary {
    background: #444 !important;
    color: #ccc !important;
    border: 1px solid #555 !important;
}

.btn-secondary:hover {
    background: #555 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #333;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: #fff;
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #007bff;
}

.loading-spinner p {
    font-size: 18px;
    font-weight: 500;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #333;
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .form-container {
        padding: 24px;
    }
    
    .form-title {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .element-fields {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Drag and Drop */
.backup-elements-container.drag-over {
    background: #2a2a2a;
    border: 2px dashed #007bff;
    border-radius: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #444;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #888;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 123, 255, 0.1);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00d4ff);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

.fab.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Field Focus Effects */
.form-input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

/* Hover Effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.backup-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

/* Form Validation States */
.form-group.error .form-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.success .form-input {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-group .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Save Indicator */
.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator i {
    margin-right: 8px;
    color: #fff;
}

/* Section Transitions */
.form-section {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-radio {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.radio-option label {
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
    margin: 0;
}

.radio-option label:hover {
    color: #fff;
}

/* Form Help Text */
.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* État de chargement */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.loading-state i {
    font-size: 2em;
    margin-bottom: 20px;
    color: #007bff;
}

.loading-state p {
    margin: 0;
    font-size: 1.1em;
}

/* Responsive Radio Group */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
}
