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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
    color: #333;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 1.5rem;
    color: #4a5568;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

input[type="password"], 
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="password"]:focus, 
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 0.5rem;
}

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

.btn-primary:hover {
    background-color: #5a67d8;
}

.btn-secondary {
    background-color: #68d391;
    color: white;
}

.btn-secondary:hover {
    background-color: #48bb78;
}

.error {
    background-color: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
}

hr {
    margin: 1rem 0;
    border: none;
    height: 1px;
    background-color: #e2e8f0;
}

/* App-specific styles */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    color: #4a5568;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.header-controls button {
    padding: 8px 12px;
    font-size: 14px;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    background-color: #f7fafc;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f7fafc;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.shopping-list-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category {
    margin-bottom: 2rem;
}

.category h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.2rem;
}

.category-fruits h3 { border-bottom-color: #fc8181; }
.category-veggies h3 { border-bottom-color: #68d391; }
.category-indian h3 { border-bottom-color: #fbb040; }
.category-misc h3 { border-bottom-color: #a78bfa; }

.item-list {
    list-style: none;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f7fafc;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.item-list li:hover {
    background-color: #edf2f7;
}

.remove-btn {
    background-color: #fc8181;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-btn:hover {
    background-color: #f56565;
}

.empty-message {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 2rem;
}

.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    color: #4a5568;
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
}

.setting-section {
    margin-bottom: 2rem;
}

.setting-section h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.fingerprint-status p {
    margin-bottom: 1rem;
    color: #718096;
    line-height: 1.5;
}

.btn-danger {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .search-section, .shopping-list-section {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .header-controls button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    #searchInput {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
}