* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.site-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.header-text {
    flex: 1;
}

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

.header p {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.site-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

.site-link:hover {
    text-decoration: underline;
}

.info-box {
    background: #e8f4f8;
    border-left: 4px solid #0066cc;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
}

.info-box strong {
    color: #0066cc;
}

/* Avertissement légal */
.disclaimer-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
    transition: all 0.3s ease;
}

.disclaimer-box.minimized {
    padding: 12px 20px;
    background: #fffbf0;
}

.disclaimer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.disclaimer-header h3 {
    color: #856404;
    margin: 0;
    font-size: 1.2em;
    padding-bottom: 0;
}

.disclaimer-content h3 {
    border-bottom: 2px solid #ffc107;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.disclaimer-toggle {
    background: transparent;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.disclaimer-toggle:hover {
    background: #ffc107;
    color: white;
}

.disclaimer-box p {
    color: #664d03;
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.9em;
}

.disclaimer-box p strong {
    color: #856404;
    display: block;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.disclaimer-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ffc107;
}

.btn-accept {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-accept:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

.disclaimer-minimized {
    display: none;
}

.disclaimer-minimized p {
    margin: 0;
    color: #664d03;
    font-size: 0.9em;
}

.disclaimer-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 5px;
}

.disclaimer-link:hover {
    color: #0052a3;
}

.main-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.controls-panel {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.controls-panel h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.slider-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.slider-container.overtime {
    background: #fff8e1;
    border-color: #ffb300;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
}

input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 1em;
    margin-top: 5px;
    background: white;
}

.value-display {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #0066cc;
    margin-top: 10px;
}

.overtime-tax {
    color: #e65100;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
}

.savings {
    color: #2e7d32;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.summary-card.highlight {
    background: #0066cc;
    color: white;
}

.summary-card h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.8;
    font-weight: 500;
}

.summary-card .amount {
    font-size: 1.8em;
    font-weight: 700;
}

.summary-card .subtitle {
    font-size: 0.75em;
    margin-top: 5px;
    opacity: 0.7;
}

.overtime-card {
    margin-top: 15px;
}

.summary-card.overtime-impact {
    background: #fff3e0;
    border: 1px solid #ffb300;
}

.summary-card.overtime-impact h3 {
    color: #e65100;
    opacity: 1;
}

.overtime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.overtime-grid .label,
.overtime-rate .label {
    font-size: 0.85em;
    color: #795548;
    margin-bottom: 5px;
}

.overtime-grid .value,
.overtime-rate .value {
    font-size: 1.2em;
    font-weight: 600;
    color: #e65100;
}

.overtime-rate {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 179, 0, 0.3);
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-container h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.chart-container p {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.chart-container p strong {
    color: #0066cc;
}

.chart-container .tip {
    color: #2e7d32;
    font-weight: 600;
}

.chart-wrapper {
    height: 350px;
    position: relative;
}

.bar-legend {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.legend-header {
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    margin-bottom: 6px;
    padding: 3px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.legend-item:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Nouvelle légende dynamique avec montants */
.dynamic-legend {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: fadeIn 0.3s ease-in;
}

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

.legend-dynamic-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-dynamic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.legend-dynamic-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.legend-dynamic-header {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.legend-dynamic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.legend-dynamic-item.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.legend-dynamic-item .legend-text {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-dynamic-item .legend-palier {
    font-size: 0.85em;
    opacity: 0.95;
}

.legend-dynamic-item .legend-montant {
    font-weight: 700;
    font-size: 1em;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    min-width: 80px;
    text-align: right;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.legend-dynamic-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.05em;
}

.legend-dynamic-total .total-amount {
    color: #ffd700;
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.legend-pedagogic-message {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.5;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.legend-pedagogic-message .highlight {
    background: rgba(255, 215, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Couleurs des paliers - Québec */
.quebec-1 { background: #cfe2ff; }
.quebec-2 { background: #6ea8fe; }
.quebec-3 { background: #0a58ca; }
.quebec-4 { background: #052c65; }

/* Couleurs des paliers - Fédéral */
.federal-1 { background: #fff3cd; }
.federal-2 { background: #ffecb5; }
.federal-3 { background: #ffc107; }
.federal-4 { background: #ff9800; }
.federal-5 { background: #ff5722; }

.key-concept {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.concept-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 5px;
}

.concept-text {
    font-size: 0.85em;
    color: #664d03;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

.details-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.details-header h2 {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.toggle-button {
    background: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.toggle-button:hover {
    background: #0052a3;
}

.details-content {
    display: none;
}

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

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-block {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.detail-block h3 {
    color: #0066cc;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.detail-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.detail-line:last-child {
    border-bottom: none;
    font-weight: 600;
}

.tables-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-container h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    text-align: left;
    border: 1px solid #dee2e6;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.pedagogic-section {
    background: #0066cc;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
    color: white;
}

.pedagogic-section h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

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

.pedagogic-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pedagogic-card h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.pedagogic-card p {
    font-size: 0.95em;
    line-height: 1.5;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted #0066cc;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
}

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

canvas {
    max-width: 100%;
    height: auto;
}

/* Footer */
.footer {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer p {
    color: #6c757d;
    margin: 0;
}

.footer a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.article-link {
    display: inline-block;
    padding: 8px 20px;
    background: #0066cc;
    color: white !important;
    border-radius: 5px;
    transition: background 0.3s;
}

.article-link:hover {
    background: #0052a3;
    text-decoration: none !important;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        position: static;
    }
    
    .details-grid, .tables-section {
        grid-template-columns: 1fr;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .site-logo {
        width: 60px;
        height: 60px;
    }
}

/* Styles pour les éléments pédagogiques des détails */
.detail-explanation {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.detail-explanation .detail-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.95em;
}

.detail-explanation .detail-line:last-child {
    border-bottom: none;
}

.detail-explanation .detail-line span:first-child {
    color: #2c3e50;
    font-weight: 500;
}

.detail-explanation .detail-line span:last-child {
    color: #0056b3;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.revenu-imposable {
    background: rgba(255, 255, 255, 0.4) !important;
    border-radius: 6px;
    padding: 10px 8px !important;
    margin: 8px 0;
    border: 1px solid rgba(0, 86, 179, 0.2) !important;
}

.revenu-imposable span:last-child {
    color: #d63384 !important;
    font-size: 1.1em;
    font-weight: 700 !important;
}

.detail-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #0066cc 50%, transparent 100%);
    margin: 20px 0;
    border-radius: 1px;
}

.total-line {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border: 1px solid #b6d7a8 !important;
    border-radius: 6px;
    padding: 12px 15px !important;
    margin: 15px 0 !important;
    font-weight: 600 !important;
}

.total-line span:first-child {
    color: #155724 !important;
    font-size: 1.05em;
}

.total-line span:last-child {
    color: #155724 !important;
    font-size: 1.15em;
    font-weight: 700 !important;
}