/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover {
    background-color: #34495e;
}

.nav-item.active {
    background-color: #3498db;
}

.nav-item span {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* Top Bar */
.top-bar {
    background-color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.top-bar h1 {
    font-size: 1.8rem;
    color: #2c3e50;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
}

.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
}

/* Quick Actions */
.quick-actions {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.quick-actions h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background-color: #3498db;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn:hover {
    background-color: #2980b9;
}

.action-btn span {
    font-size: 1.3rem;
}

/* Week Preview */
.week-preview {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-preview h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.day-preview {
    padding: 15px;
    border-left: 4px solid #3498db;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.day-preview h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.day-preview p {
    margin: 5px 0;
    color: #555;
}

.no-plans {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

.no-plans a {
    color: #3498db;
    text-decoration: none;
}

.no-plans a:hover {
    text-decoration: underline;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recipe-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e0e0e0;
}

.recipe-info {
    padding: 15px;
}

.recipe-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    background-color: #3498db;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
    text-align: right;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Shopping List */
.shopping-category {
    margin-bottom: 30px;
}

.category-header {
    background-color: #3498db;
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-items {
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.shopping-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item.checked {
    text-decoration: line-through;
    opacity: 0.6;
}

.shopping-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.item-details {
    flex: 1;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Weekly Planner */
.week-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.day-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.day-header {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.meal-slot {
    padding: 15px;
    margin-bottom: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.meal-slot.filled {
    border: 2px solid #3498db;
    background-color: #e8f4f8;
}

.meal-type {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.meal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-btn {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}