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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.menu {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.menu a {
    text-decoration: none;
    color: #667eea;
    font-weight: bold;
    transition: color 0.3s;
}

.menu a:hover {
    color: #764ba2;
}

.nav {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.title {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5em;
}

.archivio-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

#searchInput, #filterSort {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

#searchInput {
    flex: 1;
    min-width: 200px;
}

#searchInput:focus, #filterSort:focus {
    outline: none;
    border-color: #667eea;
}

.archivio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.recipe-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.recipe-header h2 {
    color: #667eea;
    font-size: 1.3em;
}

.date {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
}

.recipe-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.piatto {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.piatto h3 {
    color: #764ba2;
    margin-bottom: 8px;
}

.piatto p {
    color: #555;
    margin-bottom: 8px;
}

.piatto-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 10px;
}

.recipe-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.btn-view, .btn-restore, .btn-delete {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 0.9em;
}

.btn-view {
    background: #667eea;
    color: white;
}

.btn-view:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.btn-restore {
    background: #4caf50;
    color: white;
}

.btn-restore:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
    transform: scale(1.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.meta {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.modal-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.modal-section h2 {
    color: #764ba2;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.modal-section img {
    width: 100%;
    border-radius: 6px;
    margin: 10px 0;
}

.modal-section p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.loading, .empty, .error {
    text-align: center;
    color: #999;
    font-size: 1.1em;
    padding: 40px;
}

.error {
    color: #f44336;
}

.dev {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .archivio-grid {
        grid-template-columns: 1fr;
    }

    .archivio-controls {
        flex-direction: column;
    }

    #searchInput {
        min-width: auto;
    }

    .title {
        font-size: 1.8em;
    }
}