/* PREVIUS - Design Professionnel et Épuré */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    background: var(--bg-secondary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Cards Container */
.cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Top row - Two equal cards */
.cards-container .row:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cards-container .row:first-child .col-lg-6 {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Ensure equal height for cards in top row */
.cards-container .row:first-child .col-lg-6 .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 520px; /* Slightly increased to accommodate larger details section */
}

.cards-container .row:first-child .col-lg-6 .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling if content is too long */
}

/* Ensure results section maintains card structure */
.cards-container .row:first-child .col-lg-6 .card .card-body #results {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cards-container .row:first-child .col-lg-6 .card .card-body #noResults {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Reduce the details section to maintain card balance */
.cards-container .row:first-child .col-lg-6 .card .card-body .info-section {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.cards-container .row:first-child .col-lg-6 .card .card-body .info-section h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cards-container .row:first-child .col-lg-6 .card .card-body .info-section p {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.cards-container .row:first-child .col-lg-6 .card .card-body .info-section .small {
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Bottom row - Full width card */
.cards-container .row:last-child {
    margin-top: 0;
}

.cards-container .row:last-child .col-12 .card {
    width: 100%;
}

/* Responsive adjustments for the new layout */
@media (max-width: 768px) {
    .cards-container .row:first-child {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .cards-container .row:first-child .col-lg-6 {
        flex: none;
        width: 100%;
    }
    
    .cards-container .row:first-child .col-lg-6 .card {
        min-height: 500px; /* Slightly smaller on mobile but still consistent */
    }
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(6, 78, 59, 0.1));
    border-bottom: 2px solid var(--success-color);
    padding: 0.5rem 1rem 1rem 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.02), rgba(6, 78, 59, 0.05));
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--success-color), #047857);
    border-radius: 2px;
}

header h1 {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 i {
    background: linear-gradient(135deg, var(--success-color), #047857);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 0.75rem;
}

header .lead {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

header .carfo-text {
    color: var(--success-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    opacity: 0.95;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.badge {
    background: linear-gradient(135deg, var(--success-color), #047857);
    color: white;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success-color), #047857);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--success-color);
}

.card-header {
    background: linear-gradient(135deg, var(--success-color), #047857);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.card-header h3 {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-body {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.5), rgba(255, 255, 255, 0.8));
}

/* Form Styles */
.form-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    width: 100%;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-invalid {
    border-color: #dc2626;
}

/* Button */
.btn-primary {
    background: linear-gradient(135deg, var(--success-color), #047857);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #047857, var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Result Cards */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.8));
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--success-color), #047857);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover::before {
    opacity: 1;
}

.result-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--success-color);
}

.result-card h3 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.375rem;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-card h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-card small {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Special Result Cards */
.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
}

.result-card.primary h3,
.result-card.primary h5,
.result-card.primary small {
    color: white;
}

.result-card.success {
    background: linear-gradient(135deg, var(--success-color), #047857);
    color: white;
    border: none;
}

.result-card.success h3,
.result-card.success h5,
.result-card.success small {
    color: white;
}

.result-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #b45309);
    color: white;
    border: none;
}

.result-card.warning h3,
.result-card.warning h5,
.result-card.warning small {
    color: white;
}

.result-card.info {
    background: linear-gradient(135deg, var(--info-color), #0e7490);
    color: white;
    border: none;
}

.result-card.info h3,
.result-card.info h5,
.result-card.info small {
    color: white;
}

/* Info Sections */
.info-section {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.9));
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.info-section:hover {
    border-color: var(--success-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.info-section h5 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-section ul li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

.info-section ul li i {
    color: var(--success-color);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.info-section ul li i.text-warning {
    color: var(--warning-color);
}

/* Formula Box */
.formula-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.1));
    border: 2px solid var(--success-color);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.formula-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--success-color), #047857);
}

.formula-box p {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Alert */
.alert {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 2px solid #dc2626;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    color: #991b1b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.alert:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
}

.alert .btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    color: #991b1b;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.5), rgba(255, 255, 255, 0.8));
    border-radius: 1rem;
    border: 2px dashed var(--border-color);
    backdrop-filter: blur(10px);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.empty-state h5 {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
    width: 100%;
}

footer .card {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.9));
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

footer p {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

footer small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer .badge {
    background: var(--text-light);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.success-pulse {
    animation: successPulse 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cards-container {
        padding: 0 1rem;
    }
    
    header {
        padding: 0.75rem 0;
        margin-bottom: 0.75rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header .lead {
        font-size: 0.75rem;
    }
    
    header .carfo-text {
        font-size: 0.625rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card h3 {
        font-size: 1.75rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1rem;
    }
    
    /* Stack cards vertically on mobile */
    .cards-container .row:first-child .col-lg-6 {
        margin-bottom: 1.5rem;
        width: 100% !important;
    }
    
    /* Force full width on mobile */
    .cards-container .row:first-child {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Bottom card full width on mobile */
    .cards-container .row:last-child .col-12 {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .cards-container {
        padding: 0 0.5rem;
    }
    
    header {
        padding: 0.5rem 0;
        margin-bottom: 0.75rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    header .lead {
        font-size: 0.625rem;
    }
    
    header .carfo-text {
        font-size: 0.5rem;
    }
    
    .badge {
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1.125rem;
    }
    
    .result-card {
        padding: 1rem;
    }
    
    .result-card h3 {
        font-size: 1.5rem;
    }
    
    /* Ensure proper spacing on small screens */
    .row.g-4 {
        margin: 0;
    }
    
    .cards-container .row:first-child .col-lg-6 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
        width: 100% !important;
    }
    
    /* Force column layout on very small screens */
    .cards-container .row:first-child {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Bottom card adjustments for small screens */
    .cards-container .row:last-child .col-12 {
        padding: 0 0.5rem;
    }
}

/* Focus Styles */
.btn-primary:focus,
.form-control:focus {
    outline: none;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-primary {
        display: none;
    }
} 