/* ========================================
   STYLES MC3D LINE - APPLICATION CDC
   Design moderne et professionnel
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ED0596;
    --primary-dark: #622BAA;
    --secondary: #622BAA;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 30px 40px;
    text-align: center;
}

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

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

/* ========================================
   NAVIGATION ONGLETS
   ======================================== */
.tabs {
    display: flex;
    background: var(--light-gray);
    border-bottom: 3px solid var(--border);
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.tab-button.active {
    color: var(--primary);
    background: var(--white);
    border-bottom-color: var(--primary);
}

/* ========================================
   CONTENU DES ONGLETS
   ======================================== */
.tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* ========================================
   FORMULAIRES
   ======================================== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Checkboxes stylisées */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

/* ========================================
   BOUTONS
   ======================================== */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   RÉSULTATS ANALYSE
   ======================================== */
.results-section {
    margin-top: 30px;
}

.material-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.material-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.material-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.material-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success);
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.technology-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tech-fdm {
    background: #dbeafe;
    color: #1e40af;
}

.tech-sla {
    background: #fce7f3;
    color: #9f1239;
}

.tech-sls {
    background: #d1fae5;
    color: #065f46;
}

.material-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    background: var(--light-gray);
    padding: 12px;
    border-radius: 8px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.scoring-details {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 8px;
}

.scoring-details h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.scoring-details ul {
    list-style: none;
}

.scoring-details li {
    padding: 5px 0;
    color: var(--dark);
    font-size: 0.95rem;
}

/* ========================================
   COMPARAISON TECHNOLOGIES
   ======================================== */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.tech-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ========================================
   ALERTES ET NOTIFICATIONS
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

/* ========================================
   LOADER
   ======================================== */
.loader {
    display: none;
    text-align: center;
    padding: 40px;
}

.loader.active {
    display: block;
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .tab-button {
        font-size: 0.85rem;
        padding: 14px 12px;
    }

    .tab-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .material-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   IMPRESSION
   ======================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .tabs,
    .button-group,
    .btn {
        display: none !important;
    }

    .container {
        box-shadow: none;
    }
}
