/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f8f8f8;
    color: #333;
}

.hidden {
    display: none !important;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
#app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    height: 50px;
    display: flex;
    align-items: center;
}

.logo-img {
    max-height: 100%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#datetime-display {
    color: #666;
    font-size: 0.9rem;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: #666;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    min-width: 120px;
    display: none;
    z-index: 10;
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #333;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

.dropdown:hover .dropdown-menu, 
.dropdown:focus-within .dropdown-menu {
    display: block;
}

/* Auth Pages */
#auth-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-page {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-page .logo {
    margin-bottom: 2rem;
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
}

.wave-emoji {
    font-size: 1.2em;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-position: 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
}

#signin-email, #signup-email {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999" viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>');
}

.password-input {
    position: relative;
}

#signin-password, #signup-password {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999" viewBox="0 0 24 24"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>');
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.form-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.form-check label {
    margin-left: 0.5rem;
}

.forgot-link {
    color: #996b57;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background-color: #996b57;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #875e4c;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer a {
    color: #996b57;
    text-decoration: none;
    font-weight: 500;
}

/* Meal Planning Page */
#app-content {
    flex: 1;
    padding: 2rem;
}

.page-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.meal-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nutrition-chart {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.chart-legend {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.legend-color.protein {
    background-color: #ff6b6b;
}

.legend-color.fat {
    background-color: #ffd166;
}

.legend-color.carbs {
    background-color: #06d6a0;
}

.legend-color.minerals {
    background-color: #4dabf7;
}

.food-options {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.food-options h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.food-options p {
    color: #666;
    margin-bottom: 1.5rem;
}

.option-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.tab-btn.active {
    background-color: #996b57;
    color: white;
}

.food-items-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.food-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.food-item.selected {
    background-color: #f0e0db;
    border: 1px solid #996b57;
}

.food-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.food-details {
    flex: 1;
}

.food-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.food-details p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.food-metrics {
    display: flex;
    gap: 1rem;
}

.metric {
    background-color: #f5f5f5;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Waiting Page */
#waiting-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.page-subtitle {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 1rem;
}

.refresh-info {
    color: #666;
    margin-bottom: 3rem;
}

.hourglass-container {
    margin-bottom: 3rem;
}

.hourglass {
    width: 80px;
    height: 80px;
    background-color: #ffd166;
    clip-path: polygon(0% 0%, 100% 0%, 80% 50%, 100% 100%, 0% 100%, 20% 50%);
    position: relative;
}

.hourglass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: #996b57;
}

.hourglass::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: #996b57;
}

/* Responsive Design */
@media (max-width: 992px) {
    .meal-container {
        flex-direction: column;
    }
    
    .chart-legend {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #app-header {
        padding: 1rem;
    }
    
    .user-info {
        gap: 0.5rem;
    }
    
    #datetime-display {
        display: none;
    }
    
    .auth-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .chart-legend {
        grid-template-columns: 1fr;
    }
}
