body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(226, 242, 255, 0.98), rgba(219, 234, 254, 0.92) 30%, rgba(224, 242, 255, 0.8) 100%);
    color: #0f172a;
}

#app {
    max-width: 980px;
    margin: 0 auto 40px;
    padding: 0;
    /* background: #f8fbff; */
    background: none;
    border-radius: 0;
    box-shadow: none;
}

h1 {
    text-align: center;
    color: #0f172a;
    margin-bottom: 24px;
    font-size: 2rem;
    letter-spacing: 0.03em;
    font-weight: 700;
}

#view-switcher {
    display: inline-flex;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 18px;
    background: #eef4ff;
    padding: 8px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(148, 185, 255, 0.4);
}

#view-switcher button {
    background-color: transparent;
    color: #1e3a8a;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.25s ease;
}

#view-switcher button:hover {
    background: rgba(59, 130, 246, 0.14);
    color: #0f172a;
}

#view-switcher button.active {
    background: #2563eb;
    color: white;
    box-shadow: none;
}

#calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0 auto 18px;
    padding: 18px 20px;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

#calendar-header button {
    background-color: #ffffff;
    color: #1d4ed8;
    border: 1px solid rgba(148, 185, 255, 0.7);
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    font-weight: 700;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

#calendar-header button .material-icons-round {
    font-size: 22px;
    line-height: 1;
}

#calendar-header button:hover {
    background-color: #eff6ff;
}

#current-month {
    margin: 0;
    font-size: 1.4rem;
    color: #0f172a;
}

#calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(209, 213, 219, 0.9);
}

.day {
    border-right: 1px solid rgba(209, 213, 219, 0.9);
    border-bottom: 1px solid rgba(209, 213, 219, 0.9);
    background: #ffffff;
    min-height: 150px;
    border-radius: 0;
    box-sizing: border-box;
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

.day:nth-child(7n) {
    border-right: none;
}

#calendar .day:last-child,
#calendar .day:nth-last-child(-n+7) {
    border-bottom: none;
}

.day-number {
    font-weight: 700;
    font-size: 0.98rem;
    padding: 10px 12px 6px;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 1;
    color: #111827;
}

.events-container {
    overflow-y: auto;
    padding: 0 8px 8px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.events-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.events-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.other-month {
    background-color: #f5f5f5;
    opacity: 0.5;
    pointer-events: none;
}

.other-month .day-number {
    color: #aaa;
    background-color: #f5f5f5;
}

.other-month .event {
    background-color: #b0b0b0;
}

.day-header {
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    padding: 6px 0;
    margin: 0;
    color: #64748b;
    border-bottom: 1px solid rgba(209, 213, 219, 0.95);
}

.day.day-header {
    height: auto;
    min-height: 0;
    padding: 6px 0;
    overflow: visible;
}

.event {
    background-color: #1d4ed8;
    color: #1e293b;
    padding: 2px 10px;
    margin: 0;
    cursor: pointer;
    border-radius: 10px;
    word-wrap: break-word;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    font-size: 14px;
    line-height: 1.2;
    align-self: start;
}

.event:hover {
    background-color: #2563eb;
}

#event-detail-page {
    max-width: 760px;
    margin: 24px auto 36px;
    padding: 0 18px;
}

.event-back-button {
    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid rgba(148, 185, 255, 0.7);
    padding: 9px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.event-back-button:hover {
    background: #eff6ff;
}

.event-detail-card {
    background: #ffffff;
    border: 1px solid rgba(209, 213, 219, 0.9);
    border-radius: 8px;
    padding: 18px 20px 20px 22px;
    position: relative;
    overflow: hidden;
}

.event-detail-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #1d4ed8;
}

#event-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #0f172a;
}

.event-date-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.event-date-row .material-icons-round {
    font-size: 18px;
    color: #2563eb;
}

.event-description {
    margin: 0 0 14px;
    color: #334155;
    line-height: 1.6;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.event-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #475569;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.event-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

#event-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    margin-top: 2px;
}

.event-not-found {
    margin: 0;
    color: #475569;
}

#legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto 24px;
    gap: 10px;
    padding: 12px 14px;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.72);
    color: #0f172a;
    border: 1px solid rgba(148, 185, 255, 0.45);
}

.legend-item:hover {
    background: rgba(239, 246, 255, 0.95);
    border-color: rgba(96, 165, 250, 0.55);
}

.legend-item.active {
    background-color: #eff6ff;
    border-color: rgba(59, 130, 246, 0.75);
}

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

.hidden {
    display: none;
}

#timeline {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 28px;
    position: relative;
}

#timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 11px;
    bottom: 0;
    width: 2px;
    background: #bfdbfe;
}

.timeline-day-group {
    position: relative;
    padding-bottom: 24px;
}

.timeline-day-group::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #2563eb;
}

.timeline-date-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    padding: 2px 0 10px 0;
    background: transparent;
    border: none;
}

.timeline-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-content {
    padding: 12px 16px 12px 20px;
    background: #ffffff;
    border: 1px solid rgba(209, 213, 219, 0.9);
    color: #0f172a;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    transition: background 0.15s ease;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #1d4ed8;
}

.timeline-content:hover {
    background: #f0f6ff;
}

.timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    margin: 0;
}

.timeline-desc {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
    margin: 2px 0 4px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.4;
}

.timeline-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #475569;
}

.timeline-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

/* Responzívny dizajn */
/* Mobilné zariadenia - menej ako 600px */
@media (max-width: 600px) {
    body {
        margin: 10px;
    }
    
    #calendar-header {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    #calendar-header button {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    #current-month {
        font-size: 18px;
    }
    
    #calendar {
        max-width: 100%;
        grid-template-columns: repeat(7, 1fr);
        gap: 0;
    }
    
    .day {
        height: 80px;
        padding: 5px;
        font-size: 12px;
    }
    
    .day-header {
        font-size: 12px;
    }
    
    .event {
        font-size: 11px;
        padding: 1px 3px;
    }
    
    #legend {
        max-width: 100%;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    #timeline {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 4px;
    }

    #timeline::before {
        left: 4px;
        top: 10px;
    }

    .timeline-day-group {
        padding-bottom: 18px;
    }

    .timeline-day-group::before {
        left: -27px;
        top: 3px;
        width: 16px;
        height: 16px;
    }

    .timeline-date-header {
        padding: 1px 0 8px 0;
        font-size: 0.8rem;
    }

    .timeline-content {
        padding: 10px 12px 10px 16px;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .timeline-date {
        text-align: left;
        min-width: auto;
    }
}

/* Tablety - 600px až 900px */
@media (min-width: 600px) and (max-width: 900px) {
    #app {
        padding: 20px 18px 28px;
    }

    #calendar-header {
        padding-left: 8px;
        padding-right: 8px;
    }

    #legend {
        padding-left: 8px;
        padding-right: 8px;
    }

    #calendar {
        max-width: 100%;
        grid-template-columns: repeat(7, 1fr);
        gap: 0;
    }
    
    .day {
        height: 120px;
        padding: 8px;
    }
    
    #timeline {
        max-width: 100%;
        padding-left: 28px;
        padding-right: 12px;
    }
}

@media (min-width: 901px) and (max-width: 1000px) {
    #app {
        padding-left: 18px;
        padding-right: 18px;
    }

    #calendar-header {
        padding-left: 8px;
        padding-right: 8px;
    }

    #legend {
        padding-left: 8px;
        padding-right: 8px;
    }

    #timeline {
        padding-right: 12px;
    }
}

@media (max-width: 600px) {
    #event-detail-page {
        margin-top: 16px;
        padding: 0 12px;
    }

    .event-detail-card {
        padding: 16px 14px 16px 18px;
    }

    #event-title {
        font-size: 1.35rem;
    }
}