/**
 * Styles publics - Calculateurs Techniques Bâtiment
 * 
 * @package CalculateursTechniques
 * @since 1.0.0
 */

/* Variables CSS globales */
:root {
    --ct-primary: #2c5aa0;
    --ct-secondary: #1e3a8a;
    --ct-accent: #4CAF50;
    --ct-success: #4CAF50;
    --ct-warning: #FF9800;
    --ct-error: #f44336;
    --ct-info: #2196F3;
    --ct-light: #f8f9fa;
    --ct-dark: #343a40;
    --ct-text: #333;
    --ct-text-light: #666;
    --ct-border: #dee2e6;
    --ct-shadow: rgba(0,0,0,0.1);
    --ct-shadow-hover: rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--ct-text);
    margin: 0;
    padding: 0;
    background: var(--ct-light);
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem 0;
}

/* Layout */
.ct-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.ct-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

.ct-col {
    flex: 1;
    padding: 0 1rem;
}

/* Grille responsive */
.ct-grid {
    display: grid;
    gap: 2rem;
}

.ct-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ct-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ct-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Cartes et conteneurs */
.ct-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--ct-shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ct-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--ct-shadow-hover);
}

.ct-card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ct-accent);
}

.ct-card-title {
    color: var(--ct-primary);
    margin: 0;
}

/* Boutons */
.ct-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.ct-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

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

.ct-btn-primary:hover {
    background: var(--ct-secondary);
    color: white;
}

.ct-btn-secondary {
    background: var(--ct-light);
    color: var(--ct-text);
    border: 1px solid var(--ct-border);
}

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

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

.ct-btn-success:hover {
    background: #45a049;
    color: white;
}

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

.ct-btn-warning:hover {
    background: #e68900;
    color: white;
}

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

.ct-btn-error:hover {
    background: #d32f2f;
    color: white;
}

/* Boutons de taille */
.ct-btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.ct-btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.ct-btn-xl { padding: 1.25rem 2.5rem; font-size: 1.25rem; }

/* Boutons de largeur */
.ct-btn-block {
    display: block;
    width: 100%;
}

/* Formulaires */
.ct-form-group {
    margin-bottom: 1.5rem;
}

.ct-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--ct-text);
}

.ct-form-input,
.ct-form-select,
.ct-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--ct-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.ct-form-input:focus,
.ct-form-select:focus,
.ct-form-textarea:focus {
    outline: none;
    border-color: var(--ct-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

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

.ct-form-checkbox,
.ct-form-radio {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.ct-form-checkbox input,
.ct-form-radio input {
    margin-right: 0.5rem;
}

/* États des formulaires */
.ct-form-input.is-valid {
    border-color: var(--ct-success);
}

.ct-form-input.is-invalid {
    border-color: var(--ct-error);
}

.ct-form-feedback {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.ct-form-feedback.is-valid {
    color: var(--ct-success);
}

.ct-form-feedback.is-invalid {
    color: var(--ct-error);
}

/* Alertes et messages */
.ct-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.ct-alert-success {
    background: #e8f5e8;
    color: var(--ct-success);
    border-left-color: var(--ct-success);
}

.ct-alert-warning {
    background: #fff3e0;
    color: var(--ct-warning);
    border-left-color: var(--ct-warning);
}

.ct-alert-error {
    background: #ffebee;
    color: var(--ct-error);
    border-left-color: var(--ct-error);
}

.ct-alert-info {
    background: #e3f2fd;
    color: var(--ct-info);
    border-left-color: var(--ct-info);
}

/* Badges */
.ct-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.ct-badge-primary { background: var(--ct-primary); color: white; }
.ct-badge-secondary { background: var(--ct-secondary); color: white; }
.ct-badge-success { background: var(--ct-success); color: white; }
.ct-badge-warning { background: var(--ct-warning); color: white; }
.ct-badge-error { background: var(--ct-error); color: white; }

/* Tableaux */
.ct-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.ct-table th,
.ct-table td {
    padding: 0.75rem;
    border: 1px solid var(--ct-border);
    text-align: left;
}

.ct-table th {
    background: var(--ct-light);
    font-weight: 600;
    color: var(--ct-text);
}

.ct-table tbody tr:hover {
    background: var(--ct-light);
}

/* Navigation */
.ct-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ct-nav-item {
    margin-right: 1rem;
}

.ct-nav-link {
    color: var(--ct-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ct-nav-link:hover {
    background: var(--ct-light);
    color: var(--ct-primary);
}

.ct-nav-link.active {
    background: var(--ct-primary);
    color: white;
}

/* Pagination */
.ct-pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.ct-pagination-item {
    margin: 0 0.25rem;
}

.ct-pagination-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ct-border);
    border-radius: 6px;
    color: var(--ct-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.ct-pagination-link:hover {
    background: var(--ct-light);
    border-color: var(--ct-primary);
}

.ct-pagination-link.active {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
    color: white;
}

/* Utilitaires */
.ct-text-center { text-align: center; }
.ct-text-left { text-align: left; }
.ct-text-right { text-align: right; }

.ct-text-primary { color: var(--ct-primary); }
.ct-text-secondary { color: var(--ct-secondary); }
.ct-text-success { color: var(--ct-success); }
.ct-text-warning { color: var(--ct-warning); }
.ct-text-error { color: var(--ct-error); }
.ct-text-muted { color: var(--ct-text-light); }

.ct-bg-primary { background: var(--ct-primary); }
.ct-bg-secondary { background: var(--ct-secondary); }
.ct-bg-success { background: var(--ct-success); }
.ct-bg-warning { background: var(--ct-warning); }
.ct-bg-error { background: var(--ct-error); }
.ct-bg-light { background: var(--ct-light); }

.ct-m-0 { margin: 0; }
.ct-m-1 { margin: 0.25rem; }
.ct-m-2 { margin: 0.5rem; }
.ct-m-3 { margin: 1rem; }
.ct-m-4 { margin: 1.5rem; }
.ct-m-5 { margin: 3rem; }

.ct-p-0 { padding: 0; }
.ct-p-1 { padding: 0.25rem; }
.ct-p-2 { padding: 0.5rem; }
.ct-p-3 { padding: 1rem; }
.ct-p-4 { padding: 1.5rem; }
.ct-p-5 { padding: 3rem; }

/* Responsive */
@media (max-width: 1200px) {
    .ct-container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .ct-container {
        max-width: 720px;
    }
    
    .ct-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .ct-container {
        max-width: 540px;
        padding: 0 1rem;
    }
    
    .ct-grid-2,
    .ct-grid-3,
    .ct-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .ct-card {
        padding: 1.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 576px) {
    .ct-container {
        padding: 0 0.5rem;
    }
    
    .ct-card {
        padding: 1rem;
    }
    
    .ct-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .ct-nav {
        flex-direction: column;
    }
    
    .ct-nav-item {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

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

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

@keyframes ct-slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.ct-slide-in {
    animation: ct-slideIn 0.3s ease-out;
}

/* États de chargement */
.ct-loading {
    position: relative;
    pointer-events: none;
}

.ct-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--ct-border);
    border-top: 2px solid var(--ct-primary);
    border-radius: 50%;
    animation: ct-spin 1s linear infinite;
}

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

/* Spécifique aux calculateurs */
.ct-calculator-icon {
    font-size: 3rem;
    margin-right: 1rem;
}

.ct-result-card {
    background: var(--ct-light);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--ct-border);
}

.ct-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ct-primary);
    margin-bottom: 0.5rem;
}

.ct-result-label {
    color: var(--ct-text);
    font-weight: 500;
}

/* Formulaire de lead */
.ct-lead-form {
    background: var(--ct-light);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.ct-lead-form h3 {
    color: var(--ct-primary);
    margin-bottom: 1rem;
}

.ct-lead-form p {
    margin-bottom: 1.5rem;
    color: var(--ct-text-light);
}

/* Formules */
.ct-formulas {
    background: var(--ct-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.ct-formula-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--ct-accent);
}

.ct-formula-name {
    font-weight: 600;
    color: var(--ct-primary);
    margin-bottom: 0.5rem;
}

.ct-formula-formula {
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.ct-formula-description {
    color: var(--ct-text-light);
    font-size: 0.9rem;
}
