@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,slnt,wdth,wght,GRAD,ROND@6..144,-10..0,25..151,1..1000,0..100,0..100&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Google Sans Flex', sans-serif;
    user-select: text;
    -webkit-user-drag: none;
}

*::selection {
    color: #8859ff;
    background: #f2edff;
}

.back-link, .logo, .navigation-controls, #current-month-year, button, .weekdays-grid, .weekdays-grid div, .day-cell, .day-number, .shift-tag, .status-badge, .detail-label, .brand, .brand h1, .subtitle, .settings-toggle, .settings-tray, .settings-label, .toggle-group, .toggle-option, .view-switcher-container, .view-switcher, .switcher-btn, .agenda-date-info, .agenda-weekday, .agenda-day, #details-date, .details-placeholder, img, svg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    min-height: 100vh;
    background: #121212;
    color: #f2edff;
    font-family: 'Google Sans Flex', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
    position: relative;
    overflow-x: hidden;
}

.calendar-container {
    width: 100%;
    max-width: 720px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #bfaaff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #ffffff;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    color: #8859ff;
    background: #ffffff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 800;
    font-variation-settings: 'ROND' 100, 'wdth' 85;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 0.85rem;
    color: #bfaaff;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.navigation-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 0.35rem 0.5rem;
}

.navigation-controls button {
    background: none;
    border: none;
    color: #bfaaff;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.navigation-controls button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.navigation-controls button:active {
    transform: scale(0.92);
}

#current-month-year {
    font-size: 1rem;
    font-weight: 600;
    min-width: 110px;
    text-align: center;
}

/* Calendar Card */
.calendar-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

/* Weekdays labels */
.weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 0.75rem;
}

.weekdays-grid div {
    font-size: 0.8rem;
    font-weight: 600;
    color: #bfaaff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
}

/* Calendar Grid */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

/* Individual Day Cell */
.day-cell {
    aspect-ratio: 1.05;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.day-cell:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.day-number {
    font-size: 1rem;
    font-weight: 600;
    color: #dfdbe5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Adjacent/Previous Month Days */
.day-cell.adjacent-month {
    opacity: 0.25;
}

.day-cell.adjacent-month:hover {
    opacity: 0.5;
}

/* Today Highlighter */
.day-cell.today .day-number {
    border: 2px solid #8859ff;
    color: #ffffff;
}

/* Day with shift - Purple styling */
.day-cell.has-shift {
    background: rgba(136, 89, 255, 0.08);
    border-color: rgba(136, 89, 255, 0.25);
}

.day-cell.has-shift:hover {
    background: rgba(136, 89, 255, 0.16);
    border-color: rgba(136, 89, 255, 0.5);
}

.day-cell.has-shift .day-number {
    background: #8859ff;
    color: #ffffff;
}

.shift-tag {
    font-size: 0.65rem;
    font-weight: 600;
    color: #bfaaff;
    background: rgba(136, 89, 255, 0.15);
    border-radius: 4px;
    padding: 2px 4px;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: auto;
}

/* Selected State - Purple */
.day-cell.selected {
    background: rgba(255, 255, 255, 0.12);
    border-color: #8859ff;
}

.day-cell.selected.has-shift {
    background: rgba(136, 89, 255, 0.25);
}

/* Details Panel Card */
.details-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.details-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bfaaff;
    text-align: center;
    font-size: 0.95rem;
}

.details-placeholder p {
    max-width: 320px;
    line-height: 1.5;
}

.details-content {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.details-content.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.details-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.status-badge {
    background: #8859ff;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.status-badge.off-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #bfaaff;
}

.details-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    align-items: baseline;
    font-size: 0.95rem;
}

.detail-label {
    width: 80px;
    color: #bfaaff;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-val {
    color: #ffffff;
    font-weight: 600;
}

.time-row .detail-val {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.duration {
    color: #bfaaff;
    font-weight: 400;
    font-size: 0.85rem;
}

.note-val {
    font-style: normal;
    color: #dfdbe5;
    font-weight: 400;
}

.hidden {
    display: none !important;
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #bfaaff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.settings-toggle:hover, .settings-toggle.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-toggle:active {
    transform: scale(0.92);
}

.settings-tray {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slide-down 0.2s ease-out;
}

@keyframes slide-down {
    0% { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.settings-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #bfaaff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2px;
}

.toggle-option {
    background: none;
    border: none;
    color: #bfaaff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.toggle-option:hover {
    color: #ffffff;
}

.toggle-option.active {
    background: #ffffff;
    color: #121212;
}

/* View Switcher */
.view-switcher-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.view-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2px;
}

.switcher-btn {
    background: none;
    border: none;
    color: #bfaaff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.switcher-btn:hover {
    color: #ffffff;
}

.switcher-btn.active {
    background: #ffffff;
    color: #121212;
}

/* Agenda / List Layout styles */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.agenda-list::-webkit-scrollbar {
    width: 6px;
}
.agenda-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
.agenda-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.agenda-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.agenda-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.agenda-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.agenda-item.selected {
    background: rgba(136, 89, 255, 0.08);
    border-color: #8859ff;
}

.agenda-date-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 1rem;
}

.agenda-weekday {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #bfaaff;
    letter-spacing: 0.05em;
}

.agenda-day {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 2px;
}

.agenda-shift-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agenda-time {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agenda-duration {
    font-size: 0.7rem;
    font-weight: 450;
    color: #bfaaff;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 10px;
}

.agenda-notes {
    font-size: 0.8rem;
    color: #dfdbe5;
    font-weight: 400;
}

.agenda-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #bfaaff;
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .calendar-container {
        gap: 1rem;
    }
    
    .brand h1 {
        font-size: 1.5rem;
    }
    
    .calendar-card {
        padding: 1rem 0.5rem;
        border-radius: 18px;
    }
    
    .weekdays-grid div {
        font-size: 0.7rem;
    }
    
    .day-cell {
        border-radius: 8px;
        padding: 0.35rem;
    }
    
    .day-number {
        font-size: 0.85rem;
        width: 22px;
        height: 22px;
    }
    
    .shift-tag {
        font-size: 0.55rem;
        padding: 1px 2px;
    }
    
    .details-card {
        padding: 1.25rem 1rem;
        border-radius: 18px;
    }
    
    .details-header h3 {
        font-size: 1.1rem;
    }
    
    .detail-row {
        font-size: 0.9rem;
    }
}

@media (max-width: 500px) {
    .calendar-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }
    
    .brand {
        flex-direction: column;
        text-align: center;
    }
    
    .header-right-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .settings-tray {
        border-radius: 12px;
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .shift-tag {
        display: none !important;
    }
    
    .day-cell {
        justify-content: center;
        align-items: center;
        aspect-ratio: 1;
        padding: 0.25rem;
    }
    
    .day-cell.has-shift::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        background-color: #8859ff;
        border-radius: 50%;
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    .day-number {
        margin: 0;
    }
    
    .agenda-item {
        gap: 0.75rem;
        padding: 0.6rem 0.75rem;
    }
    
    .agenda-date-info {
        min-width: 50px;
        padding-right: 0.75rem;
    }
    
    .agenda-day {
        font-size: 0.75rem;
    }
    
    .agenda-time {
        font-size: 0.8rem;
    }
}
