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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.password-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.password-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-box h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
}

#password-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

#password-input:focus {
    outline: none;
    border-color: #667eea;
}

.password-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.password-error {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 0.9em;
    min-height: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.calculator {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1024px) {
    .calculator {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }
    
    .calculator-main {
        flex: 1;
        min-width: 0;
    }
    
    .recipe-list-section {
        flex: 0 0 350px;
        margin-top: 0;
        max-height: calc(100vh - 180px);
    }
}

.input-section {
    margin-bottom: 0;
}

.input-section label {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

#liters {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

#liters:focus {
    outline: none;
    border-color: #667eea;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 400px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.option-group select {
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
}

.results-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 0;
}

.results-section h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

#results {
    margin-bottom: 20px;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ingredient-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ingredient-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.ingredient-amount {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 700;
}

.recipe-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.print-btn, .add-btn {
    padding: 15px;
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.print-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.add-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.print-btn:hover, .add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.print-btn:active, .add-btn:active {
    transform: translateY(0);
}

.recipe-list-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.recipe-list-section h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #48bb78;
    padding-bottom: 8px;
}

#recipe-list {
    margin-bottom: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.recipe-list-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-list-item-info {
    flex: 1;
}

.recipe-list-item-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.recipe-list-item-details {
    font-size: 0.9em;
    color: #666;
}

.recipe-list-item-remove {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.recipe-list-item-remove:hover {
    background: #c53030;
}

#list-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.print-all-btn, .clear-btn {
    padding: 15px;
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.print-all-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.clear-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
}

.print-all-btn:hover, .clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.print-all-btn:active, .clear-btn:active {
    transform: translateY(0);
}

.print-all-container {
    display: none;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .options {
        grid-template-columns: 1fr;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .container {
        border-radius: 10px;
    }
    
.calculator {
    padding: 20px 15px;
    flex-direction: column;
}
    
    .results-section {
        padding: 15px;
    }
    
    .ingredient-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .ingredient-name {
        font-size: 0.95em;
    }
    
    .ingredient-amount {
        font-size: 1em;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }
    
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        box-sizing: border-box;
    }
    
    html, body {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        font-size: 14px;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .password-screen {
        display: none !important;
    }
    
    .container {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 50% !important;
        width: 50% !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid;
        height: auto !important;
        overflow: visible !important;
    }
    
    header {
        display: none !important;
    }
    
    header h1 {
        font-size: 2em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .calculator {
        padding: 20px;
        page-break-inside: avoid;
    }
    
    .input-section,
    .print-btn,
    .add-btn,
    .recipe-list-section {
        display: none !important;
    }
    
    /* Verberg main container wanneer we alle recepten printen */
    body.printing-all #main-container {
        display: none !important;
    }
    
    .print-all-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .print-page {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        max-width: 100% !important;
        page-break-after: always;
        min-height: auto;
        height: auto;
        margin: 0;
        padding: 0;
    }
    
    .print-page:last-child {
        page-break-after: auto;
    }
    
    .print-recipe {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0;
        margin: 0;
        padding: 0;
    }
    
    .print-recipe-item {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .print-recipe-item .results-section {
        background: white;
        padding: 20px;
        border-radius: 0;
        page-break-inside: avoid;
    }
    
    .print-recipe-item .results-section h2 {
        font-size: 1.6em;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .print-results {
        margin-bottom: 0;
    }
    
    .print-recipe-item .ingredient-item {
        padding: 10px 15px;
        margin-bottom: 6px;
        border-left-width: 4px;
        page-break-inside: avoid;
    }
    
    .print-recipe-item .ingredient-name {
        font-size: 1.05em;
    }
    
    .print-recipe-item .ingredient-amount {
        font-size: 1.1em;
    }
    
    /* Normale container styling voor enkel recept print */
    .container:not(.print-recipe-item) {
        max-width: 50%;
        width: 50%;
    }
    
    .container:not(.print-recipe-item) .results-section {
        background: white;
        padding: 20px;
        border-radius: 0;
        page-break-inside: avoid;
    }
    
    .container:not(.print-recipe-item) .results-section h2 {
        font-size: 1.6em;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .container:not(.print-recipe-item) #results {
        page-break-inside: avoid;
    }
    
    .container:not(.print-recipe-item) .ingredient-item {
        padding: 10px 15px;
        margin-bottom: 6px;
        border-left-width: 4px;
        page-break-inside: avoid;
    }
    
    .container:not(.print-recipe-item) .ingredient-name {
        font-size: 1.05em;
    }
    
    .container:not(.print-recipe-item) .ingredient-amount {
        font-size: 1.1em;
    }
}
