/* Color Variables */
:root {
    --bg-light: #F1EBE1;
    --bg-grey: #CDC0AD;
    --text-dark: #403A23;
    --text-light: #FADCCA;
    --image-viewer: #596853;
    --video-player: #5C606B;
    --audio-player: #826845;
    --email: #CB7041;
    --notepad: #CAA242;
    --stratosphere-messenger: #35D4BE;
    --wavesplice: #B03C11;
    --assembly: #97BDE9;
    --oneiric-browser: #7B50A9;
    --file-manager: #D1C1AC;
    --mobile-breakpoint: 768px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Focus styles - removed global outline:none for accessibility */
/* Individual focus styles added per element type below */

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 80px; /* Space for footer */
}

/* Header */
.header {
    background-color: var(--email);
    color: var(--text-light);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    gap: 20px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 300;
}

/* User Profile */
.user-profile {
    position: relative;
}

.user-profile-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.user-profile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-profile-toggle:focus-visible {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--text-light);
    color: var(--email);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 300;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-header {
    padding: 16px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--bg-grey);
}

.user-menu-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.user-menu-email {
    font-size: 12px;
    color: #8B7D6B; /* Slightly darker than bg-grey, lighter than text-dark */
    opacity: 0.85;
}

.user-menu-divider {
    height: 1px;
    background-color: var(--bg-grey);
    margin: 8px 0;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: not-allowed;
    opacity: 0.6;
}

.user-menu-item:hover {
    background-color: transparent;
    color: #999;
}

.user-menu-item:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: -2px;
}

.user-menu-item-danger {
    color: #999;
}

.user-menu-item-danger:hover {
    background-color: transparent;
    color: #999;
}

.user-menu-item:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: -2px;
}

/* Calendar Container */
.calendar-container {
    flex: 1;
    padding: 30px 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children to shrink */
    outline: none; /* Remove default focus outline, custom focus style added */
}

.calendar-container:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: -2px;
}

/* Calendar Navigation */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.nav-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.month-select,
.year-select {
    background-color: var(--text-light);
    border: 1px solid var(--bg-grey);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
}

.year-select option:disabled {
    color: var(--bg-grey);
    font-style: italic;
}

.month-select:focus-visible,
.year-select:focus-visible {
    outline: 3px solid var(--stratosphere-messenger);
    outline-offset: 2px;
}

/* Buttons */
.nav-btn {
    background-color: var(--text-light);
    color: var(--text-dark);
    border: none;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}

.nav-btn:hover {
    background-color: var(--bg-grey);
}

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

.nav-btn:focus-visible {
    outline: 3px solid var(--stratosphere-messenger);
    outline-offset: 2px;
}

.today-btn {
    background-color: var(--text-light);
    color: var(--text-dark);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.today-btn:hover {
    background-color: var(--bg-grey);
}

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

.today-btn:focus-visible {
    outline: 3px solid var(--stratosphere-messenger);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--email);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
    min-height: 44px;
}

.btn-primary:hover {
    background-color: var(--wavesplice);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: var(--bg-grey);
    color: var(--text-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
    min-height: 44px;
}

.btn-secondary:hover {
    background-color: var(--file-manager);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: 2px;
}

.popover-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-dark);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
}

.popover-close:hover {
    background-color: var(--bg-light);
}

.popover-close:active {
    transform: scale(0.9);
}

.popover-close:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: 2px;
}

.minimize-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: none;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);
    gap: 1px;
    background-color: var(--bg-grey);
    border: 1px solid var(--bg-grey);
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    min-height: 0; /* Important for grid to shrink */
}

.calendar-row {
    display: contents; /* Allows row to be semantic but not affect grid layout */
}

/* Mobile List View */
.calendar-list {
    display: none; /* Hidden on desktop by default */
}

.calendar-list-mobile {
    display: none; /* Hidden on desktop, shown on mobile via media query */
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

.list-month-header {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    padding: 0 16px;
}

.list-day-item {
    background-color: white;
    border-radius: 8px;
    padding: 16px;
    margin: 0 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.list-day-item.list-day-today {
    border: 2px solid var(--email);
    background-color: var(--text-light);
}

.list-day-header {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.list-placeholder {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin: 0 16px;
    text-align: center;
    opacity: 0.7;
}

.list-placeholder-text {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.list-placeholder-count {
    font-size: 11px;
    color: var(--bg-grey);
    font-style: italic;
}

.day-header {
    background-color: var(--email);
    color: var(--text-light);
    padding: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.day-cell {
    background-color: white;
    height: 100%;
    min-height: 0;
    padding: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.day-cell.other-month {
    background-color: var(--bg-light);
    opacity: 0.6;
}

.day-cell.today {
    background-color: var(--text-light);
    border: 2px solid var(--email);
}

.day-cell.inactive-year {
    opacity: 0.4;
    pointer-events: none;
}

.day-number {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

/* Events */
/* Grid View Events */
.event-block {
    position: absolute;
    left: 8px;
    right: 8px;
    background-color: var(--email);
    color: var(--text-light);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    overflow: hidden;
    transition: all 0.2s;
    z-index: 1;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    min-width: 0; /* Important for text truncation in flex children */
    border: none;
    text-align: left;
    font-family: inherit;
}

.event-block:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-block:focus-visible {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
    z-index: 2;
}

.event-block.event-greyed:focus-visible {
    outline: 3px solid var(--text-dark);
    outline-offset: 2px;
    z-index: 2;
}

/* List View Events */
.list-event-block {
    background-color: var(--email);
    color: var(--text-light);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.list-event-block:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.list-event-block:focus-visible {
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

.list-event-block.event-greyed:focus-visible {
    outline: 3px solid var(--text-dark);
    outline-offset: 2px;
}

/* Event States (shared between grid and list) */
.event-block.event-greyed,
.list-event-block.event-greyed {
    background-color: var(--bg-grey);
    color: var(--text-dark);
    opacity: 0.7;
    cursor: not-allowed;
}

.event-block.event-locked,
.list-event-block.event-locked {
    background-color: var(--email);
    color: var(--text-light);
}

.event-block.event-unlocked,
.list-event-block.event-unlocked {
    background-color: var(--stratosphere-messenger);
    color: white;
}

.event-block.event-unlocked {
    min-height: auto;
    height: auto !important;
    max-height: calc(100% - 16px);
}

.event-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    gap: 8px;
    flex-shrink: 0;
}

.event-time {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-participant {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.event-name {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lock-icon {
    font-size: 12px;
    flex-shrink: 0;
}


/* Modal & Popover */
.modal-overlay,
.popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    z-index: 1000;
}

.popover-overlay {
    z-index: 1001;
}

.modal-content,
.popover-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content {
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

.modal-event-name {
    margin-bottom: 20px;
    color: var(--email);
    font-weight: 500;
}

/* Input Fields */
.password-input,
.subscribe-input {
    width: 100%;
    border: 1px solid var(--bg-grey);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
    box-sizing: border-box;
}

.password-input {
    padding: 12px;
    margin-bottom: 20px;
}

.subscribe-input {
    padding: 10px;
    margin-bottom: 12px;
}

.password-input:focus,
.subscribe-input:focus {
    outline: 3px solid var(--email);
    outline-offset: 2px;
    border-color: var(--email);
}

.security-note {
    font-size: 11px;
    color: var(--bg-grey);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bg-grey);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.error-message {
    color: var(--wavesplice);
    font-size: 12px;
    margin-top: 10px;
}

.floating-box-content .error-message {
    margin-top: 12px;
    margin-bottom: 0;
}


.popover-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.popover-date {
    color: var(--bg-grey);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popover-title {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 12px;
}

.popover-time {
    color: var(--stratosphere-messenger);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.popover-text {
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.popover-text p {
    margin-bottom: 12px;
}

.popover-text p:last-child {
    margin-bottom: 0;
}

.popover-files {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.file-attachment-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    background-color: var(--bg-light);
    border: 1px solid var(--bg-grey);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    cursor: pointer;
}

.file-attachment-button:hover {
    background-color: var(--bg-grey);
    border-color: var(--email);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-attachment-button:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: 2px;
}

.file-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.file-name {
    font-weight: 400;
    word-break: break-all;
}

.popover-attendee {
    padding-top: 16px;
    border-top: 1px solid var(--bg-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
}

.popover-attendee-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popover-attendee-label {
    color: var(--bg-grey);
    font-weight: 400;
}

.popover-attendee-name {
    color: var(--text-dark);
    font-weight: 500;
}


@keyframes celebrate {
    0% {
        transform: scale(1);
        color: var(--text-dark);
    }
    15% {
        transform: scale(2.5) rotate(-10deg);
        color: var(--stratosphere-messenger);
        font-weight: 700;
    }
    30% {
        transform: scale(2.5) rotate(10deg);
        color: var(--stratosphere-messenger);
        font-weight: 700;
    }
    45% {
        transform: scale(2.5) rotate(-10deg);
        color: var(--stratosphere-messenger);
        font-weight: 700;
    }
    60% {
        transform: scale(2.5) rotate(10deg);
        color: var(--stratosphere-messenger);
        font-weight: 700;
    }
    75% {
        transform: scale(1.8) rotate(-5deg);
        color: var(--stratosphere-messenger);
        font-weight: 700;
    }
    100% {
        transform: scale(1);
        color: var(--text-dark);
        font-weight: 500;
    }
}

/* Success Message */
.success-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--stratosphere-messenger);
    color: white;
    padding: 15px 40px 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 15px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Floating Boxes */
.floating-box {
    position: fixed;
    bottom: 20px;
    width: 280px;
    background-color: white;
    border: 2px solid var(--email);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-subscribe {
    right: 20px;
}

.floating-box.minimized {
    width: auto;
    min-width: 200px;
}

.floating-box-header {
    background-color: var(--email);
    color: var(--text-light);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.floating-box.minimized .floating-box-header {
    border-radius: 6px;
}

.floating-box-header span {
    font-weight: 500;
    font-size: 14px;
}

.floating-box-header:focus-visible {
    outline: 3px solid var(--text-light);
    outline-offset: -2px;
}

.floating-box-content {
    padding: 16px;
}

.floating-box-content p {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--text-dark);
}


.floating-box-content .btn-primary {
    width: 100%;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-grey);
    padding: 15px 40px;
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.footer-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--email);
}

.footer-link.inactive {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    text-decoration: none;
}

.footer-link.inactive:hover {
    color: #999;
}

.footer-link.inactive:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: 2px;
}

.footer-link:focus-visible {
    outline: 3px solid var(--email);
    outline-offset: 2px;
    text-decoration: underline;
}

/* Responsive Design for Desktop/Laptop */
@media (min-width: 1024px) and (max-width: 1440px) {
    .calendar-container {
        padding: 20px 30px;
    }
}

@media (min-width: 1441px) {
    .calendar-container {
        max-width: 1600px;
    }
}

/* Tablet and below */
@media (max-width: 1023px) {
    .calendar-container {
        padding: 15px 20px;
    }
    
    .floating-box {
        width: 240px;
    }
    
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .calendar-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .user-profile {
        order: 2;
    }
    
    .header-left {
        order: 1;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    
    /* Header */
    .header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 12px;
        position: relative;
    }
    
    .header-left {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
        min-width: 0;
    }
    
    .header-title {
        font-size: 20px;
        margin: 0;
        line-height: 1.2;
    }
    
    .header-subtitle {
        font-size: 11px;
    }
    
    .calendar-nav {
        display: none; /* Hide navigation on mobile */
    }
    
    /* Show mobile list, hide desktop grid */
    .calendar-grid-desktop {
        display: none;
    }
    
    .calendar-list-mobile {
        display: flex;
    }
    
    .nav-btn {
        width: auto;
        height: auto;
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .today-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .month-select,
    .year-select {
        padding: 8px 8px;
        font-size: 13px;
    }
    
    .user-profile {
        order: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0;
        align-self: flex-start;
    }
    
    .user-info {
        display: none; /* Hide user info text on mobile, keep avatar */
    }
    
    .user-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }
    
    /* Calendar Container */
    .calendar-container {
        padding: 10px 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .calendar-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .calendar-container::-webkit-scrollbar-track {
        background: var(--bg-light);
    }
    
    .calendar-container::-webkit-scrollbar-thumb {
        background: var(--bg-grey);
        border-radius: 3px;
    }
    
    /* Calendar Grid */
    .calendar-grid {
        min-width: 100%;
        width: 100%;
        gap: 0.5px;
    }
    
    .day-header {
        padding: 8px 4px;
        font-size: 12px;
        font-weight: 500;
    }
    
    .day-cell {
        padding: 4px;
        min-height: 60px;
    }
    
    .day-number {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    /* Event Block */
    .event-block {
        left: 4px;
        right: 4px;
        padding: 4px 6px;
        font-size: 11px;
        min-height: 40px;
        max-width: calc(100% - 8px);
    }
    
    .event-time {
        font-size: 10px;
    }
    
    .event-participant {
        font-size: 9px;
    }
    
    .event-name {
        font-size: 11px;
    }
    
    .lock-icon {
        font-size: 10px;
    }
    
    /* Modals and Popovers */
    .modal-content,
    .popover-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 20px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .popover-title {
        font-size: 20px;
    }
    
    .popover-close {
        top: 10px;
        right: 10px;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    /* Floating Boxes */
    .floating-box {
        width: calc(100% - 30px);
        max-width: 320px;
        bottom: 70px; /* Above footer to avoid overlap */
    }
    
    .floating-subscribe {
        right: 15px;
        left: auto;
    }
    
    .floating-box.minimized {
        min-width: 160px;
    }
    
    .floating-box-header {
        padding: 10px 12px;
    }
    
    .floating-box-header span {
        font-size: 13px;
    }
    
    .floating-box-content {
        padding: 12px;
    }
    
    .floating-box-content p {
        font-size: 12px;
    }
    
    /* Footer */
    .footer {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .footer-link {
        font-size: 12px;
    }
    
    /* Success Message */
    .success-message {
        top: 60px;
        left: 15px;
        right: 15px;
        transform: none;
        padding: 12px 35px 12px 15px;
        font-size: 13px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .calendar-container {
        padding: 8px 4px;
    }
    
    .list-day-item,
    .list-placeholder {
        margin: 0 8px;
        padding: 12px;
    }
    
    .list-month-header {
        padding: 0 8px;
        font-size: 18px;
    }
    
    .modal-content,
    .popover-content {
        padding: 15px;
        margin: 10px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    .popover-title {
        font-size: 18px;
    }
    
    .floating-box {
        width: calc(100% - 20px);
        bottom: 65px; /* Above footer to avoid overlap */
    }
    
    .floating-subscribe {
        right: 10px;
        left: auto;
    }
    
    .footer {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .footer-link {
        font-size: 11px;
    }
    
    .success-message {
        top: 50px;
        left: 10px;
        right: 10px;
        padding: 10px 30px 10px 12px;
        font-size: 12px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-grid-desktop {
        display: none;
    }
    
    .calendar-list-mobile {
        display: flex;
    }
    
    .floating-box {
        bottom: 60px;
    }
}

/* Accessibility Utilities */
/* Screen reader only - visually hidden but accessible to assistive tech */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip link - hidden by default, visible on focus */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--email);
    color: var(--text-light);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--text-light);
    outline-offset: 2px;
}

