@import 'navbar.css';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
}

/* ================== MAIN MENU ================== */
.main-menu {
    text-align: center;
    padding: 40px 20px;
}

.main-menu h1 {
    color: white;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-menu .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    margin-bottom: 60px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.menu-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    padding: 40px 30px;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.menu-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background: white;
}

.menu-button:active {
    transform: translateY(-2px);
}

/* ================== PAGE CONTAINER ================== */
.page-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-height: 600px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.page-header h2 {
    color: #333;
    font-size: 2em;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
}

.back-button:hover {
    background: #5a6268;
}

.primary-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
}

.primary-button:hover {
    background: #218838;
}

.secondary-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
    margin-left: 10px;
}

.secondary-button:hover {
    background: #0056b3;
}

.danger-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.danger-button:hover {
    background: #c82333;
}

/* ================== FILTERS & SEARCH ================== */
.filters-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.filter-select {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    min-width: 180px;
}

/* ================== TABLES ================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 10px;
    /* Reduced from 15px */
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 8px 10px;
    /* Reduced from 15px */
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .checkbox-cell {
    text-align: center;
    width: 40px;
}

.data-table .actions-cell {
    text-align: right;
    width: 100px;
    white-space: nowrap;
}

.actions-container {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/* GREY COLUMNS (BRUTTO) */
.data-table .grey-column {
    background: #e9ecef;
}

/* BLUE COLUMNS (calculated for N portions) */
.data-table .blue-column {
    background: #cfe2ff;
    color: #084298;
    font-weight: 600;
}

/* ================== FORMS ================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* ================== RECIPE DETAIL ================== */
.recipe-header {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 30px;
}

.recipe-params {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.recipe-photo {
    width: 100%;
    height: 300px;
    border-radius: 15px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 3em;
}

.ingredients-section {
    margin-top: 30px;
}

.ingredients-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.ingredients-table {
    width: 100%;
    border-collapse: collapse;
}

.ingredients-table th {
    background: #28a745;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ingredients-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.ingredients-table input,
.ingredients-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ingredients-table .total-row {
    font-weight: 700;
    background: #f8f9fa;
}

.add-ingredient-btn {
    margin-top: 10px;
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.add-ingredient-btn:hover {
    background: #138496;
}

/* ================== PRINT STYLES ================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .page-container {
        box-shadow: none;
        padding: 20px;
    }

    .print-header {
        text-align: center;
        margin-bottom: 30px;
    }

    .ingredients-table {
        page-break-inside: avoid;
    }
}

/* ================== UTILITY ================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}