:root {
    --primary-red: #e3000f;
    --primary-red-hover: #b3000c;
    --secondary-red: #ffcdd2;
    --white: #ffffff;
    --bg-color: #f8f9fa;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --glass-bg: rgba(255, 255, 255, 0.98);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.background-decor {
    position: fixed;
    top: 0; right: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 90% 10%, rgba(227, 0, 15, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 10% 90%, rgba(227, 0, 15, 0.05) 0%, transparent 40%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    text-align: center;
}

.logo-container { 
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none; /* Allows clicks to pass through if necessary */
}
.logo { max-width: 200px; height: auto; opacity: 0.9; }
header h2 { font-weight: 800; font-size: 1.8rem; letter-spacing: -0.5px; }
header p { color: var(--text-muted); }

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow);
}



.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.option-column {
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    height: 100%;
}

.highlight-y {
    border: 2px solid var(--primary-red);
    background-color: rgba(227, 0, 15, 0.01);
}

.badge {
    position: absolute;
    top: 10px; right: 10px;
    background: #444; color: #fff;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

.badge-premium { background: var(--primary-red); }

.image-wrapper {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inputs-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-grow: 1;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #444;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit; font-weight: 600;
}

.input-group label i {
    width: 16px;
    margin-right: 5px;
    color: var(--primary-red);
    opacity: 0.8;
}

.stat span i {
    width: 16px;
    margin-right: 5px;
    color: var(--text-muted);
}

.profit-input-group label i {
    color: white !important;
}

.input-group input:focus {
    outline: none; border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(227, 0, 15, 0.1);
}

.premium-slider {
    background: rgba(227, 0, 15, 0.05);
    padding: 1rem;
    border-radius: 12px;
}

.range-container {
    display: flex; align-items: center; gap: 1rem;
}

.range-value {
    font-weight: 800; color: var(--primary-red);
    min-width: 45px;
}

.results-area {
    padding: 1rem;
    background: #f1f3f5;
    border-radius: 12px;
}

.stat {
    display: flex; justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat .val { font-weight: 800; color: var(--text-main); }

.difference-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-red), #ba000d);
    color: white;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 20px;
}

.big-number {
    font-size: 3rem; font-weight: 900;
    margin: 1rem 0;
}

.difference-card.standard-better {
    background: linear-gradient(135deg, #444, #222);
}

.difference-card.standard-better .big-number {
    color: #ffcdd2; /* Lighter red for contrast on dark */
}

.difference-card.premium-better {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
}

.profit-input-group {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 0 !important;
}

.profit-input-group label {
    color: white !important;
    text-align: left;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.profit-input-group input {
    background: white !important;
    color: var(--primary-red) !important;
    border: none !important;
    font-size: 1.2rem !important;
    text-align: center;
}

.profit-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 1.5rem 0;
}

.difference-text {
    width: 100%;
    margin: 0 auto;
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

/* Range appearance */
input[type="range"] {
    flex-grow: 1; height: 6px; appearance: none;
    background: #dee2e6; border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none; width: 22px; height: 22px;
    background: var(--primary-red); border-radius: 50%;
    cursor: pointer; border: 3px solid #fff;
}

/* Modal & Gallery */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.active { display: flex; }

.modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    border: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f8f9fa;
    text-align: center;
    padding-bottom: 0.5rem;
}

.gallery-item:hover {
    border-color: var(--primary-red);
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.gallery-item span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.image-wrapper {
    cursor: pointer;
    position: relative;
}

.image-wrapper::after {
    content: "Changer l'image";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(227, 0, 15, 0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-wrapper:hover::after { opacity: 1; }

.floating-reset {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto !important;
}

.floating-reset:hover {
    background: var(--primary-red);
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(227, 0, 15, 0.4);
}

.floating-reset i { font-size: 1rem; }

@media (max-width: 900px) {
    .options-container { grid-template-columns: 1fr; }
    header { flex-direction: column; text-align: center; gap: 0.5rem; }
    .logo-container { order: -1; }
}
