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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main content */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Form sections */
.form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.form-section h2 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.section-note {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 20px;
    font-style: italic;
}

/* Input groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.85rem;
}

/* Dimensions grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Remarques section */
.remarques-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.remarques-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.remarques-content {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    white-space: pre-line;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4a5568;
}

/* Content questions section */
.form-section .content-questions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-section .question-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section .question-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-section .content-selector {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-section .content-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-section .content-selector:hover {
    border-color: #cbd5e0;
}

.form-section .content-selector option {
    padding: 10px;
}

/* Warning styles for dangerous content */
.form-section .content-warning {
    background: #fed7d7;
    border: 2px solid #fc8181;
    color: #c53030;
}

.form-section .content-warning:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Results section */
.results-section {
    grid-column: 1 / -1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-section h2 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 3px solid #48bb78;
    padding-bottom: 10px;
}

/* Comparator section */
.comparator-section {
    grid-column: 1 / -1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.comparator-section h2 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.comparator-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.comparator-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.comparator-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.comparator-table tbody tr:hover {
    background-color: #f7fafc;
}

.comparator-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.comparator-table tbody tr:nth-child(even):hover {
    background-color: #e2e8f0;
}

.mode-name {
    font-weight: 600;
    color: #4a5568;
}

.base-facturation {
    text-align: center;
    font-weight: 500;
}

.cout-envoi {
    text-align: right;
    font-weight: 600;
    color: #2d3748;
}

.cout-total {
    text-align: right;
    font-weight: 700;
    color: #1a202c;
}

.status-valid {
    background: #c6f6d5;
    color: #22543d;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.status-error {
    background: #fed7d7;
    color: #c53030;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.best-price {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: white !important;
}

.best-price .mode-name,
.best-price .base-facturation,
.best-price .cout-envoi,
.best-price .cout-total {
    color: white !important;
}

.best-price .status-valid {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Results grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.result-item.total {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border-color: #38a169;
}

.result-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item span {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #2d3748;
}

.result-item.total span {
    color: white;
}

.result-item small {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Error message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin-top: 20px;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .result-item span {
        font-size: 1.5rem;
    }
}

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

.form-section,
.results-section {
    animation: fadeIn 0.6s ease-out;
}

/* Hover effects */
.input-group input:hover,
.input-group select:hover {
    border-color: #cbd5e0;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success highlight */
.success-highlight {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        background-color: #c6f6d5;
    }
    100% {
        background-color: transparent;
    }
}

