* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
    margin: 0;
    padding: 0;
}

body.splash-active {
    display: block;
    min-height: 100vh;
    background: none;
}

#splashPage.active {
    display: block;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#loginPage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

#dashboardPage.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
    z-index: 200;
    overflow-y: auto;
}

/* Login Page Styles */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    min-height: 20px;
}

.info-text {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* Splash Page Styles */
.splash-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 100;
}

.splash-content {
    flex: 1;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.35) 100%), 
                url('../images/splashdinner.png') center/cover no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    gap: 40px;
    padding: 60px 40px;
    margin: 0;
}

.splash-overlay {
    display: none;
}

.splash-card-wrapper {
    position: relative;
    z-index: 3;
    animation: slideUp 1s ease-out;
}

.splash-meal {
    width: 100%;
    max-width: 480px;
}

.splash-meal h2 {
    text-align: center;
    color: white !important;
    margin-bottom: 25px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.8) !important;
}

.splash-meal-card {
    background: transparent !important;
    backdrop-filter: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.splash-meal-card:hover {
    transform: translateY(-8px);
    box-shadow: none !important;
}

.splash-text {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    animation: slideUp 1s ease-out 0.2s both;
}

.splash-text h1 {
    font-size: 72px;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.7);
    letter-spacing: -1px;
}

.splash-text p {
    font-size: 28px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    font-weight: 300;
    letter-spacing: 0.5px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-action-section {
    background: transparent;
    backdrop-filter: none;
    padding: 30px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: none;
    box-shadow: none;
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0;
    pointer-events: none;
}

.splash-action-section .btn-primary {
    pointer-events: auto;
}

.today-meal {
    width: 100%;
    max-width: 500px;
}

.today-meal h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.meal-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.meal-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.3);
}

.meal-image {
    display: none;
}

.splash-meal-card h3 {
    padding: 0 !important;
    color: white !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.8) !important;
    margin-bottom: 15px !important;
}

.splash-meal-card p {
    padding: 0 !important;
    color: white !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8) !important;
}

.meal-card h3 {
    padding: 25px 25px 10px;
    color: #222;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.meal-card p {
    padding: 0 25px 25px;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.splash-meal-card .btn-view-recipe {
    display: none;
}

.btn-view-recipe {
    margin: 0 25px 25px;
    width: calc(100% - 50px);
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

.btn-primary {
    width: 280px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(-2px);
}

.btn-secondary {
    width: auto;
    padding: 10px 20px;
    background: #95a5a6;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-logout-splash {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
    width: auto;
    padding: 12px 28px;
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.btn-logout-splash:hover {
    background: rgba(192, 57, 43, 0.95);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.navbar-buttons {
    display: flex;
    gap: 10px;
}

/* Dashboard Container */
.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    margin-bottom: 25px;
    border-radius: 12px;
    margin-top: 15px;
}

.navbar h1 {
    font-size: 22px;
}

.navbar .btn-secondary,
.navbar .btn-logout {
    width: 120px;
    padding: 5px 12px;
    font-size: 13px;
}

.navbar h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.navbar .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.navbar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

.navbar .btn-logout {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.navbar .btn-logout:hover {
    background: #c0392b;
}

.content {
    padding: 20px 0;
}

/* Meal Plan Grid */
.meal-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.meal-plan-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border-top: 4px solid #667eea;
    animation: fadeIn 0.5s ease-out;
}

.meal-plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.meal-plan-card.today {
    border-top-color: #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.meal-plan-card.today::before {
    content: "TODAY";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f39c12;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.meal-plan-card {
    position: relative;
}

.meal-plan-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.meal-plan-info {
    padding: 20px;
}

.day-label {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.meal-plan-info h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 8px;
}

.meal-plan-info p {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.meal-plan-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
}

.btn-small {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    background: #667eea;
}

.btn-small:hover {
    background: #764ba2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .meal-plan-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 600px) {
    .splash-text h1 {
        font-size: 32px;
    }

    .splash-text p {
        font-size: 18px;
    }

    .splash-content {
        padding: 30px 20px;
        gap: 30px;
    }

    .splash-action-section {
        padding: 20px;
    }

    .btn-primary {
        width: 100%;
    }

    .splash-meal h2 {
        font-size: 24px;
    }

    .meal-plan-grid {
        grid-template-columns: 1fr;
    }

    .navbar-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-secondary {
        margin-right: 0;
        width: 100%;
    }

    .btn-logout {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .login-container {
        padding: 30px 20px;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .navbar h1 {
        font-size: 20px;
    }

    .btn-logout {
        width: 100%;
    }

    .content {
        padding: 20px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 15px 15px;
}

.modal-footer .btn {
    width: auto;
    padding: 10px 25px;
}

.modal-footer .btn-secondary {
    background: #95a5a6;
}

.modal-footer .btn-primary {
    width: auto;
}

/* Edit button style */
.btn-edit {
    background: #3498db;
}

.btn-edit:hover {
    background: #2980b9;
}
