/* 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: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.btn-header-dashboard {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-header-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-header-dashboard:hover::before {
    left: 100%;
}

.btn-header-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-header-dashboard i {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.btn-header-dashboard span {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 2px;
}

.btn-header-dashboard small {
    font-size: 0.8em;
    opacity: 0.9;
    font-weight: 400;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header h1 i {
    color: #3498db;
    margin-right: 15px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    font-weight: 300;
}

/* Main content */
.main-content {
    display: grid;
    gap: 30px;
}

/* Section d'entrée */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.input-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.input-section h2 i {
    color: #e74c3c;
    margin-right: 10px;
}

#cahierCharges {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: 'Courier New', monospace;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

#cahierCharges:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

/* Stack technique */
.tech-stack {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.tech-stack h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.tech-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.tech-options label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #34495e;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.tech-options label:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.tech-options input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Boutons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-dashboard {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-dashboard {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    position: relative;
}

.btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-dashboard::after {
    content: "NEI-CEDA";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.btn-secondary {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: linear-gradient(45deg, #7f8c8d, #95a5a6);
}

/* Section des résultats */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Onglets */
.tabs {
    display: flex;
    background: #34495e;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

/* Contenu des onglets */
.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

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

.tab-pane h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.tab-pane h2 i {
    margin-right: 10px;
    color: #3498db;
}

/* Styles pour les plans générés */
.plan-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.plan-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.plan-section h4 {
    color: #34495e;
    margin: 15px 0 10px 0;
    font-size: 1.2em;
}

.plan-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.plan-section li {
    margin-bottom: 8px;
    color: #555;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.feature-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.feature-item h5 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.feature-item p {
    color: #666;
    font-size: 0.95em;
}

/* Tableaux */
.estimation-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.estimation-table th,
.estimation-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.estimation-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.estimation-table tr:hover {
    background: #f8f9fa;
}

.estimation-table .cost {
    font-weight: 600;
    color: #27ae60;
}

.estimation-table .duration {
    font-weight: 600;
    color: #3498db;
}

/* Section d'export */
.export-section {
    padding: 20px 30px;
    background: #ecf0f1;
    border-top: 1px solid #bdc3c7;
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Modal Styles (BI et Options) */
.bi-modal, .option-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.bi-modal-content, .option-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.bi-modal-header, .option-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bi-modal-header h2, .option-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.bi-modal-close, .option-modal-close {
    font-size: 2em;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}

.bi-modal-close:hover, .option-modal-close:hover {
    color: #f0f0f0;
}

.bi-modal-body, .option-modal-body {
    padding: 30px;
}

.bi-section, .option-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #4299e1;
}

.bi-section h3, .option-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.bi-section ul, .option-section ul {
    list-style: none;
    padding: 0;
}

.bi-section li, .option-section li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.bi-section li:last-child, .option-section li:last-child {
    border-bottom: none;
}

.bi-example, .option-example {
    background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
    border-left-color: #48bb78;
}

.bi-alerts, .option-alerts {
    margin-top: 15px;
}

.bi-alert, .option-alert {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: 500;
}

.bi-alert.urgent, .option-alert.urgent {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

.bi-alert.opportunity, .option-alert.opportunity, .option-alert.info {
    background: #e6fffa;
    color: #234e52;
    border-left: 4px solid #38b2ac;
}

.bi-alert.warning, .option-alert.warning {
    background: #fff3cd;
    color: #744210;
    border-left: 4px solid #ed8936;
}

.bi-alert.success, .option-alert.success {
    background: #ebf8ff;
    color: #2a4365;
    border-left: 4px solid #4299e1;
}

.bi-roi, .option-roi {
    background: linear-gradient(135deg, #fef5e7 0%, #f7fafc 100%);
    border-left-color: #ed8936;
}

.bi-roi-content, .option-roi-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.bi-roi-item, .option-roi-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.bi-roi-item.success, .option-roi-item.success {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #22543d;
    font-weight: 600;
}

.bi-modal-footer, .option-modal-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .estimation-table {
        font-size: 0.9em;
    }
    
    .bi-modal-content, .option-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .bi-modal-body, .option-modal-body {
        padding: 20px;
    }
    
    .bi-roi-content, .option-roi-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        flex: none;
    }
    
    .tech-options {
        grid-template-columns: 1fr;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
}

/* Styles pour les alertes et notifications */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
