/* Main styles for Matsedel PWA */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background: #ecf0f1;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,249,250,0.98) 100%);
    backdrop-filter: blur(20px);
    padding: 20px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    position: sticky;
    top: 10px;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.8);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Hero button (Today) */
.hero-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* Dropdown menu */
.menu-dropdown {
    position: relative;
}

.menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}

.menu-btn:hover {
    background: var(--background);
    transform: rotate(90deg);
}

.menu-btn.active {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.menu-btn.active .menu-dots::before,
.menu-btn.active .menu-dots::after,
.menu-btn.active .menu-dots {
    background: white;
}

/* Three dots menu icon */
.menu-dots {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color);
    position: relative;
}

.menu-dots::before,
.menu-dots::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color);
}

.menu-dots::before {
    top: -8px;
}

.menu-dots::after {
    bottom: -8px;
}

/* Dropdown content */
.dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.05);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.05);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: none;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-item:active {
    background: #e9ecef;
}

.dropdown-item .icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}


.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
    opacity: 0.3;
}

/* Week navigation - creative pill design */

.week-selector {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 3px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.08);
    gap: 3px;
}

.nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    position: relative;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn.prev::before {
    content: '←';
}

.nav-btn.next::before {
    content: '→';
}

.week-display {
    padding: 8px 12px;
    min-width: 45px;
    text-align: center;
    position: relative;
}

.week-number {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Quick actions - floating capsules */
.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.action-group {
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.6);
    padding: 4px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.quick-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: 0;
}

.quick-btn:hover::before {
    width: 300px;
    height: 300px;
}

.quick-btn:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.quick-btn:active {
    transform: translateY(-1px);
}

.quick-btn span {
    position: relative;
    z-index: 1;
}

.quick-btn .icon {
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.quick-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quick-btn.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}



/* Main content */
main {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Sections */
.week-overview {
    text-align: center;
    margin-bottom: 20px;
}

.timeline-indicator {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.section-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.today-section {
    margin-bottom: 20px;
}

.upcoming-section {
    margin-bottom: 30px;
}

.past-section {
    margin-top: 40px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.other-week-notice {
    background: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 20px;
}

/* Day cards */
.day-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.day-card.weekend::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.day-card.today-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.day-card.today-highlight .day-header,
.day-card.today-highlight .meal-title,
.day-card.today-highlight .meal-type {
    color: white !important;
}

.day-card.today-highlight .meal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.day-card.today-highlight .no-meal {
    color: rgba(255, 255, 255, 0.8);
}

.day-card.today-highlight .meal-link {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.day-card.today-highlight .meal-link:hover {
    background: rgba(255, 255, 255, 0.35);
}

.day-card.today-highlight .meal-comment {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.day-card.future {
    opacity: 0.95;
    border-left: 3px solid var(--secondary-color);
}

.day-card.past {
    opacity: 0.6;
    filter: grayscale(30%);
    background: #f8f9fa;
}

.days-grid.faded .day-card {
    opacity: 0.5;
    filter: grayscale(50%);
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.day-card.today-highlight:hover {
    transform: scale(1.07);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

.today-badge {
    background: #fff;
    color: var(--primary-color);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255,255,255,0.8); }
    50% { box-shadow: 0 0 20px rgba(255,255,255,1); }
}

.tomorrow-badge {
    background: var(--success-color);
    color: white;
}

.yesterday-badge {
    background: var(--text-secondary);
    color: white;
}

.future-badge {
    background: var(--secondary-color);
    color: white;
}

/* Past days toggle */
.past-days-toggle {
    margin-top: 20px;
    background: var(--background);
    border-radius: var(--radius);
    padding: 15px;
    cursor: pointer;
}

.past-days-toggle summary {
    font-weight: 500;
    color: var(--text-secondary);
    list-style: none;
    position: relative;
    padding-left: 25px;
}

.past-days-toggle summary::before {
    content: '▸';
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.past-days-toggle[open] summary::before {
    transform: rotate(90deg);
}

.past-days-toggle summary:hover {
    color: var(--primary-color);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.day-name {
    font-size: 1.4rem;
    font-weight: bold;
}

.day-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.meal {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.meal:last-child {
    margin-bottom: 0;
}

.meal-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.meal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.meal-link {
    display: inline-block;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.meal-link:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateX(2px);
}

.meal-comment {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
}

.no-meal {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.admin-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* Enhanced loading spinner */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px;
        border-radius: 15px;
    }

    .header-top {
        margin-bottom: 15px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .hero-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .hero-btn .icon {
        display: none;
    }

    .menu-btn {
        width: 36px;
        height: 36px;
    }

    .week-display {
        padding: 6px 8px;
        min-width: 40px;
    }

    .week-number {
        font-size: 1.4rem;
    }

    .nav-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .week-selector {
        padding: 2px;
        gap: 2px;
    }

    .dropdown-content {
        right: -10px;
        min-width: 200px;
    }

    main {
        padding: 15px;
    }
}

