/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2ecc71;
    --primary-dark: #27ae60;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --dark-bg: #2c3e50;
    --light-bg: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --sidebar-width: 280px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Container Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-bg) 0%, #34495e 100%);
    color: var(--text-light);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 0 1.5rem 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    padding-left: 2rem;
}

.nav-link.active {
    background: rgba(46, 204, 113, 0.2);
    border-left-color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.nav-text {
    font-size: 1rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background: var(--light-bg);
}

/* Welcome Section */
.welcome-section {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-header {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease;
}

.welcome-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease;
}

.feature-card-link {
    text-decoration: none;
    color: inherit;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 1s ease;
}

.cta-section h2 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Menu Collection Styles */
.menu-collection-section {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.page-header h1 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.menu-table {
    width: 100%;
    border-collapse: collapse;
}

.menu-table thead {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #34495e 100%);
    color: white;
}

.menu-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.menu-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.menu-table tbody tr {
    transition: background 0.2s ease;
}

.menu-table tbody tr:hover {
    background: #f8f9fa;
}

.menu-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 2rem !important;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid #ecf0f1;
    background: #f8f9fa;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 1.8rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

/* Week Planner Styles */
.week-planner-section {
    max-width: 1400px;
    margin: 0 auto;
}

.page-description {
    color: white;
    font-size: 1rem;
    margin-top: 0.5rem;
    opacity: 0.95;
}

.week-planner-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease;
}

.form-section-title {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
}

.form-row-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Days Grid */
.days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Days Table */
.days-table {
    width: 100%;
    border-collapse: collapse;
}

.days-table thead {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #34495e 100%);
    color: white;
}

.days-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    vertical-align: middle;
}

.days-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.days-table tbody tr {
    transition: background 0.2s ease;
}

.days-table tbody tr:hover {
    background: #f8f9fa;
}

.days-table tbody tr:last-child td {
    border-bottom: none;
}

.day-cell {
    font-weight: 600;
}

.day-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.day-name {
    color: var(--text-dark);
    font-size: 1rem;
    vertical-align: middle;
}

.days-table select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: white;
    cursor: pointer;
}

.days-table select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.days-table select:hover {
    border-color: #d0d3d4;
}

.checkbox-cell {
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.day-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.day-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.day-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.day-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label-day {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-label-day:hover {
    background: #f8f9fa;
}

.checkbox-label-day input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label-day span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-actions button {
    min-width: 180px;
}

/* Week Planner Result Styles */
.week-planner-result {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease;
}

.days-table tfoot {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: bold;
}

.days-table tfoot th {
    padding: 1rem;
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .container {
        flex-direction: column;
    }

    .welcome-header h1 {
        font-size: 1.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .menu-table {
        font-size: 0.85rem;
    }

    .menu-table th,
    .menu-table td {
        padding: 0.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .form-row-three {
        grid-template-columns: 1fr;
    }

    .days-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        min-width: 100%;
    }
}

/* Custom Message Box Modal */
.message-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.message-modal.show {
    background-color: rgba(0, 0, 0, 0.6);
}

.message-modal.show .message-box {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.message-box {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-icon {
    width: 48px;
    height: 48px;
    stroke-width: 2.5;
}

@keyframes iconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.message-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-dark);
}

.message-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 2rem;
    color: #555;
}

.message-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    min-width: 150px;
}

.message-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.message-button:active {
    transform: translateY(-1px);
}

/* Button Group for Confirmation Dialog */
.message-button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.message-button-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.message-button-cancel:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.message-button-confirm {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.message-button-confirm:hover {
    background: linear-gradient(135deg, #138496 0%, #2980b9 100%);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.5);
}

/* Success Message Style */
.message-box.message-success .message-icon-container {
    background: linear-gradient(135deg, #d4edda 0%, #a3d9a5 100%);
    color: #28a745;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.message-box.message-success .message-title {
    color: #28a745;
}

.message-box.message-success .message-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.message-box.message-success .message-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa87e 100%);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.5);
}

/* Error Message Style */
.message-box.message-error .message-icon-container {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #dc3545;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
    animation: iconShake 0.5s ease;
}

@keyframes iconShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.message-box.message-error .message-title {
    color: #dc3545;
}

.message-box.message-error .message-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.message-box.message-error .message-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.5);
}

/* Warning Message Style */
.message-box.message-warning .message-icon-container {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #ff9800;
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-8px); }
}

.message-box.message-warning .message-title {
    color: #ff9800;
}

.message-box.message-warning .message-button {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.message-box.message-warning .message-button:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e68900 100%);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.5);
}

/* Info Message Style */
.message-box.message-info .message-icon-container {
    background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
    color: #17a2b8;
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.3);
}

.message-box.message-info .message-title {
    color: #17a2b8;
}

.message-box.message-info .message-button {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.message-box.message-info .message-button:hover {
    background: linear-gradient(135deg, #138496 0%, #2980b9 100%);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.5);
}

/* Responsive Design */
@media (max-width: 600px) {
    .message-box {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .message-icon-container {
        width: 70px;
        height: 70px;
    }

    .message-icon {
        width: 42px;
        height: 42px;
    }

    .message-title {
        font-size: 1.5rem;
    }

    .message-text {
        font-size: 1rem;
    }

    .message-button {
        padding: 0.875rem 2.5rem;
        font-size: 1rem;
        min-width: 130px;
    }

    .message-button-group {
        width: 100%;
    }

    .message-button-group .message-button {
        flex: 1;
        min-width: 0;
    }
}
