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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #fff;
    min-height: 100vh;
    position: relative;
}

#starCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #0a0a1a, #1a1a2e);
}

body.admin-page {
    background: linear-gradient(to bottom, #0a0a1a, #1a1a2e);
}

body.admin-page #starCanvas {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(100, 150, 255, 0.8);
    letter-spacing: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.search-box input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: #667eea;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box button {
    padding: 18px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.search-box button:active {
    transform: translateY(0);
}

#results, #foodList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

.food-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.food-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.food-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(100, 150, 255, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.food-card:hover::before {
    opacity: 1;
}

.food-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #fff;
}

.food-card .category {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.food-card .level {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.food-card .level.low {
    color: #6ff0c0;
    text-shadow: 0 0 10px rgba(111, 240, 192, 0.5);
}

.food-card .level.moderate {
    color: #ffeb3b;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.food-card .level.high {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.food-card .desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.admin-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.admin-section h2 {
    margin-bottom: 20px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 1rem;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-start;
}

.form button:hover {
    opacity: 0.9;
}

.actions {
    display: flex;
    gap: 15px;
}

.actions button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.actions button:hover {
    opacity: 0.9;
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.food-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.food-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.food-item.duplicate {
    background: rgba(255, 235, 59, 0.1);
    border: 1px solid rgba(255, 235, 59, 0.5);
}

.food-item input[type="checkbox"] {
    margin-right: 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.food-item .info {
    flex: 1;
}

.food-item button {
    padding: 6px 15px;
    background: #ff6b6b;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    margin-left: 10px;
}

.food-item button:hover {
    background: #ff5252;
}

.food-item .edit-btn {
    background: #667eea;
}

.food-item .edit-btn:hover {
    background: #5a6fd6;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.batch-actions button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.batch-actions button:hover:not(:disabled) {
    opacity: 0.9;
}

.batch-actions button:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.batch-actions #selectedCount {
    color: rgba(255, 255, 255, 0.8);
}

.duplicate-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 235, 59, 0.3);
    border-radius: 15px;
    font-size: 0.8rem;
    color: #ffeb3b;
    margin-left: 10px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(20, 20, 40, 0.95);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.modal .modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal .modal-actions button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.modal .modal-actions .confirm-btn {
    background: #ff6b6b;
    color: #fff;
}

.modal .modal-actions .cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.modal .duplicate-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.modal .duplicate-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}

.modal .duplicate-item:last-child {
    margin-bottom: 0;
}

.modal .duplicate-item strong {
    color: #ffeb3b;
}

.modal .duplicate-item .delete-duplicate-btn {
    display: block;
    margin-top: 10px;
    padding: 8px 15px;
    background: #ff6b6b;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.modal .duplicate-item .delete-duplicate-btn:hover {
    background: #ff5252;
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}
