/* ============================================================================
   Les Ateliers Sucrés d'Amy - Styles CSS
   Calculateur Professionnel de Prix de Revient
   ============================================================================ */

/* === Variables CSS === */
:root {
    --primary-color: #E91E63;
    --primary-dark: #C2185B;
    --primary-light: #F8BBD0;
    --secondary-color: #FF6F00;
    --secondary-light: #FFB74D;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
    --info-color: #2196F3;
    --text-dark: #212121;
    --text-gray: #757575;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #FFF3E0 0%, #FCE4EC 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-in;
}

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

/* === Header === */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 48px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 300;
}

/* === Main Content === */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* === Cards === */
.card {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
}

.card h2 i {
    font-size: 1.2em;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 20px;
    flex: 1;
    min-width: 200px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95em;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: #BDBDBD;
}

/* === Radio Buttons === */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

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

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* === Slider === */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

#invisibleLabel {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2em;
    min-width: 60px;
    text-align: center;
    background: var(--primary-light);
    padding: 5px 15px;
    border-radius: 8px;
}

/* === Buttons === */
.btn-add,
.btn-remove,
.btn-calculate {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    background: linear-gradient(135deg, var(--success-color) 0%, #388E3C 100%);
    color: white;
    width: 100%;
    justify-content: center;
    margin-top: 15px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-remove {
    background: linear-gradient(135deg, var(--error-color) 0%, #D32F2F 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-remove:hover {
    transform: scale(1.05);
}

.btn-calculate {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #F57C00 100%);
    color: white;
    font-size: 1.2em;
    padding: 18px 40px;
    width: 100%;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 111, 0, 0.4);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

/* === Dynamic Items === */
.ingredient-item,
.equipment-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.ingredient-item:hover,
.equipment-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

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

.item-header h4 {
    color: var(--text-dark);
    font-size: 1.1em;
}

/* === Display Elements === */
.total-display,
.cost-display {
    background: linear-gradient(135deg, var(--primary-light) 0%, #F3E5F5 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: right;
    font-size: 1.1em;
    border-left: 4px solid var(--primary-color);
}

.total-display strong,
.cost-display strong {
    color: var(--primary-dark);
}

.total-display span,
.cost-display span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2em;
}

/* === Info Boxes === */
.info-box {
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.info-box.success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--success-color);
}

.info-box.error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--error-color);
}

.info-box.warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 4px solid var(--warning-color);
}

.info-box.info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid var(--info-color);
}

.info-box i {
    font-size: 1.2em;
}

/* === Help Text === */
.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: var(--text-gray);
}

/* === Calculate Section === */
.calculate-section {
    margin: 30px 0;
}

/* === Results Section === */
.results-section {
    background: linear-gradient(135deg, #FFF9C4 0%, #FFECB3 100%);
    border: 3px solid var(--secondary-color);
}

.results-section h2 {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* === Alert Box === */
.alert-box {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.05em;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.alert-box i {
    font-size: 2em;
    margin-top: 5px;
}

.alert-box.success {
    background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 100%);
    color: #1B5E20;
    border: 2px solid var(--success-color);
}

.alert-box.error {
    background: linear-gradient(135deg, #FFCDD2 0%, #EF9A9A 100%);
    color: #B71C1C;
    border: 2px solid var(--error-color);
}

.alert-box.warning {
    background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%);
    color: #E65100;
    border: 2px solid var(--warning-color);
}

/* === Results Grid === */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.result-item.highlight {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #FFF 0%, var(--primary-light) 100%);
}

.result-item.success {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #FFF 0%, #E8F5E9 100%);
}

.result-item.warning {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #FFF 0%, #FFF3E0 100%);
}

.result-item.info {
    border-color: var(--info-color);
    background: linear-gradient(135deg, #FFF 0%, #E3F2FD 100%);
}

.result-label {
    font-size: 0.95em;
    color: var(--text-gray);
    margin-bottom: 10px;
    font-weight: 500;
}

.result-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-dark);
}

/* === Cost Breakdown === */
.cost-breakdown {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.cost-breakdown h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
}

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

.breakdown-table thead {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #F57C00 100%);
    color: white;
}

.breakdown-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.breakdown-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

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

.breakdown-table .total-row {
    background: var(--primary-light);
    font-size: 1.1em;
}

.breakdown-table .total-row td {
    padding: 15px;
    border-bottom: none;
    border-top: 3px solid var(--primary-color);
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: var(--text-gray);
    font-size: 0.9em;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.8em;
    }
    
    .logo i {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h2 {
        font-size: 1.2em;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-value {
        font-size: 1.5em;
    }
    
    .btn-calculate {
        font-size: 1em;
        padding: 15px 30px;
    }
    
    .breakdown-table {
        font-size: 0.9em;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
    }
    
    .logo h1 {
        font-size: 1.5em;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-label {
        width: 100%;
    }
    
    .alert-box {
        flex-direction: column;
        text-align: center;
    }
    
    .alert-box i {
        margin-top: 0;
    }
}

/* === Print Styles === */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .btn-add,
    .btn-remove,
    .btn-calculate,
    .calculate-section {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .results-section {
        background: white;
    }
}
