/* ========================================
   PianoPlanner Apple-Style Design System
   Main stylesheet - imports design system
   ======================================== */

/* Import the new Apple Design System */
@import url('apple-design.css');

/* ========================================
   CALENDAR - Apple Calendar Style
   ======================================== */

.calendar-container {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-xl, 20px);
    box-shadow: var(--apple-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--apple-space-5, 20px) var(--apple-space-6, 24px);
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: var(--apple-space-2, 8px);
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--apple-radius-full, 9999px);
    background: var(--apple-white, #ffffff);
    border: 0.5px solid var(--apple-gray-200, #e8e8ed);
    color: var(--apple-gray-600, #636366);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.calendar-nav-btn:hover {
    background: var(--apple-gray-100, #f5f5f7);
    border-color: var(--apple-gray-300, #d2d2d7);
}

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

.calendar-title {
    font-size: var(--apple-text-lg, 20px);
    font-weight: var(--apple-weight-semibold, 600);
    color: var(--apple-gray-900, #1d1d1f);
    min-width: 200px;
    text-align: center;
}

.calendar-view-toggle {
    display: flex;
    background: var(--apple-gray-200, #e8e8ed);
    border-radius: var(--apple-radius-md, 12px);
    padding: 3px;
    gap: 2px;
}

.calendar-view-btn {
    padding: var(--apple-space-2, 8px) var(--apple-space-4, 16px);
    font-size: var(--apple-text-sm, 13px);
    font-weight: var(--apple-weight-medium, 500);
    color: var(--apple-gray-600, #636366);
    background: transparent;
    border: none;
    border-radius: var(--apple-radius-sm, 8px);
    cursor: pointer;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.calendar-view-btn:hover {
    color: var(--apple-gray-900, #1d1d1f);
}

.calendar-view-btn.active {
    background: var(--apple-white, #ffffff);
    color: var(--apple-gray-900, #1d1d1f);
    box-shadow: var(--apple-shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.04));
}

/* Calendar Grid - Week/Day View */
.calendar-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--apple-white, #ffffff);
}

.calendar-time-column {
    background: var(--apple-gray-50, #fbfbfd);
    border-right: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.calendar-time-slot {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 var(--apple-space-2, 8px);
    font-size: var(--apple-text-xs, 11px);
    color: var(--apple-gray-500, #8e8e93);
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
}

.calendar-day-column {
    border-right: 0.5px solid var(--apple-gray-100, #f5f5f7);
    position: relative;
}

.calendar-day-column:last-child {
    border-right: none;
}

.calendar-day-header {
    padding: var(--apple-space-3, 12px);
    text-align: center;
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-day-name {
    font-size: var(--apple-text-xs, 11px);
    font-weight: var(--apple-weight-semibold, 600);
    color: var(--apple-gray-500, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--apple-space-1, 4px);
}

.calendar-day-number {
    font-size: var(--apple-text-xl, 24px);
    font-weight: var(--apple-weight-medium, 500);
    color: var(--apple-gray-900, #1d1d1f);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--apple-radius-full, 9999px);
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.calendar-day-header.today .calendar-day-number {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
}

.calendar-day-header.selected .calendar-day-number {
    background: var(--apple-gray-200, #e8e8ed);
}

.calendar-hour-row {
    height: 60px;
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
    position: relative;
}

.calendar-hour-row::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 0.5px;
    background: var(--apple-gray-100, #f5f5f7);
    opacity: 0.5;
}

/* Calendar Events */
.calendar-event {
    position: absolute;
    left: 2px;
    right: 2px;
    background: var(--apple-blue-light, rgba(0, 122, 255, 0.1));
    border-left: 3px solid var(--apple-blue, #007aff);
    border-radius: var(--apple-radius-sm, 8px);
    padding: var(--apple-space-2, 8px);
    cursor: pointer;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
    overflow: hidden;
    z-index: 5;
}

.calendar-event:hover {
    transform: scale(1.02);
    box-shadow: var(--apple-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
    z-index: 10;
}

.calendar-event-title {
    font-size: var(--apple-text-sm, 13px);
    font-weight: var(--apple-weight-medium, 500);
    color: var(--apple-gray-900, #1d1d1f);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event-time {
    font-size: var(--apple-text-xs, 11px);
    color: var(--apple-gray-600, #636366);
    margin-top: 2px;
}

.calendar-event-location {
    font-size: var(--apple-text-xs, 11px);
    color: var(--apple-gray-500, #8e8e93);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: var(--apple-space-1, 4px);
}

/* Event Colors */
.calendar-event.event-blue {
    background: var(--apple-blue-light, rgba(0, 122, 255, 0.1));
    border-left-color: var(--apple-blue, #007aff);
}

.calendar-event.event-green {
    background: var(--apple-green-light, rgba(52, 199, 89, 0.12));
    border-left-color: var(--apple-green, #34c759);
}

.calendar-event.event-orange {
    background: var(--apple-orange-light, rgba(255, 149, 0, 0.12));
    border-left-color: var(--apple-orange, #ff9500);
}

.calendar-event.event-red {
    background: var(--apple-red-light, rgba(255, 59, 48, 0.12));
    border-left-color: var(--apple-red, #ff3b30);
}

.calendar-event.event-purple {
    background: var(--apple-purple-light, rgba(175, 82, 222, 0.12));
    border-left-color: var(--apple-purple, #af52de);
}

.calendar-event.event-teal {
    background: var(--apple-teal-light, rgba(90, 200, 250, 0.12));
    border-left-color: var(--apple-teal, #5ac8fa);
}

/* Month View */
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--apple-white, #ffffff);
}

.calendar-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.calendar-month-header-day {
    padding: var(--apple-space-3, 12px);
    text-align: center;
    font-size: var(--apple-text-xs, 11px);
    font-weight: var(--apple-weight-semibold, 600);
    color: var(--apple-gray-500, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-month-day {
    min-height: 100px;
    padding: var(--apple-space-2, 8px);
    border-right: 0.5px solid var(--apple-gray-100, #f5f5f7);
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
    background: var(--apple-white, #ffffff);
    cursor: pointer;
    transition: background var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

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

.calendar-month-day:hover {
    background: var(--apple-gray-50, #fbfbfd);
}

.calendar-month-day.today {
    background: var(--apple-blue-subtle, rgba(0, 122, 255, 0.05));
}

.calendar-month-day.other-month {
    background: var(--apple-gray-50, #fbfbfd);
}

.calendar-month-day.other-month .calendar-month-day-number {
    color: var(--apple-gray-400, #aeaeb2);
}

.calendar-month-day-number {
    font-size: var(--apple-text-sm, 13px);
    font-weight: var(--apple-weight-medium, 500);
    color: var(--apple-gray-900, #1d1d1f);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--apple-radius-full, 9999px);
    margin-bottom: var(--apple-space-2, 8px);
}

.calendar-month-day.today .calendar-month-day-number {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
}

.calendar-month-event {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
    padding: 2px var(--apple-space-2, 8px);
    border-radius: var(--apple-radius-xs, 4px);
    font-size: var(--apple-text-xs, 11px);
    font-weight: var(--apple-weight-medium, 500);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.calendar-month-event:hover {
    opacity: 0.9;
}

.calendar-month-more {
    font-size: var(--apple-text-xs, 11px);
    color: var(--apple-gray-500, #8e8e93);
    padding: 2px var(--apple-space-2, 8px);
    cursor: pointer;
}

.calendar-month-more:hover {
    color: var(--apple-blue, #007aff);
}

/* Current Time Indicator */
.calendar-current-time {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--apple-red, #ff3b30);
    z-index: 15;
}

.calendar-current-time::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -5px;
    width: 12px;
    height: 12px;
    background: var(--apple-red, #ff3b30);
    border-radius: var(--apple-radius-full, 9999px);
}

/* ========================================
   SERVICE CARDS - Apple Style
   ======================================== */

.service-card {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-xl, 20px);
    padding: var(--apple-space-5, 20px);
    border: 2px solid var(--apple-gray-200, #e8e8ed);
    cursor: pointer;
    transition: all var(--apple-duration-normal, 0.25s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.service-card:hover {
    border-color: var(--apple-gray-300, #d2d2d7);
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.service-card.selected {
    border-color: var(--apple-blue, #007aff);
    background: var(--apple-blue-subtle, rgba(0, 122, 255, 0.05));
}

.service-card-header {
    display: flex;
    align-items: center;
    gap: var(--apple-space-3, 12px);
    margin-bottom: var(--apple-space-3, 12px);
}

.service-color {
    width: 12px;
    height: 12px;
    border-radius: var(--apple-radius-full, 9999px);
    flex-shrink: 0;
}

.service-card h3 {
    font-size: var(--apple-text-md, 17px);
    font-weight: var(--apple-weight-semibold, 600);
    color: var(--apple-gray-900, #1d1d1f);
}

.service-card-meta {
    display: flex;
    gap: var(--apple-space-4, 16px);
    font-size: var(--apple-text-sm, 13px);
    color: var(--apple-gray-500, #8e8e93);
    margin-bottom: var(--apple-space-2, 8px);
}

.service-card-description {
    font-size: var(--apple-text-sm, 13px);
    color: var(--apple-gray-600, #636366);
    line-height: 1.5;
}

/* ========================================
   SEARCH BAR - Apple Style
   ======================================== */

.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: var(--apple-space-3, 12px) var(--apple-space-4, 16px);
    padding-left: 44px;
    font-family: var(--apple-font, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: var(--apple-text-base, 15px);
    color: var(--apple-gray-900, #1d1d1f);
    background: var(--apple-gray-100, #f5f5f7);
    border: none;
    border-radius: var(--apple-radius-lg, 16px);
    outline: none;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.search-bar input:focus {
    background: var(--apple-white, #ffffff);
    box-shadow: var(--apple-glow-blue, 0 0 0 4px rgba(0, 122, 255, 0.25));
}

.search-bar input::placeholder {
    color: var(--apple-gray-500, #8e8e93);
}

.search-bar-icon {
    position: absolute;
    left: var(--apple-space-4, 16px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--apple-gray-500, #8e8e93);
    pointer-events: none;
}

.search-bar-icon svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   DROPDOWN MENU - Apple Style
   ======================================== */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--apple-space-2, 8px);
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-lg, 16px);
    box-shadow: var(--apple-shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.12));
    min-width: 200px;
    padding: var(--apple-space-2, 8px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
    z-index: var(--apple-z-dropdown, 100);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--apple-space-3, 12px);
    padding: var(--apple-space-3, 12px) var(--apple-space-4, 16px);
    font-size: var(--apple-text-base, 15px);
    color: var(--apple-gray-900, #1d1d1f);
    border-radius: var(--apple-radius-md, 12px);
    cursor: pointer;
    transition: background var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.dropdown-item:hover {
    background: var(--apple-gray-100, #f5f5f7);
}

.dropdown-item.danger {
    color: var(--apple-red, #ff3b30);
}

.dropdown-item.danger:hover {
    background: var(--apple-red-light, rgba(255, 59, 48, 0.12));
}

.dropdown-divider {
    height: 0.5px;
    background: var(--apple-gray-200, #e8e8ed);
    margin: var(--apple-space-2, 8px) 0;
}

/* ========================================
   POPOVER - Apple Style
   ======================================== */

.popover {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-xl, 20px);
    box-shadow: var(--apple-shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.12));
    padding: var(--apple-space-5, 20px);
    min-width: 280px;
    max-width: 400px;
    z-index: var(--apple-z-popover, 600);
}

.popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--apple-space-4, 16px);
}

.popover-title {
    font-size: var(--apple-text-md, 17px);
    font-weight: var(--apple-weight-semibold, 600);
}

.popover-close {
    width: 28px;
    height: 28px;
    border-radius: var(--apple-radius-full, 9999px);
    background: var(--apple-gray-200, #e8e8ed);
    border: none;
    color: var(--apple-gray-600, #636366);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.popover-close:hover {
    background: var(--apple-gray-300, #d2d2d7);
}

/* ========================================
   ALERT BANNERS - Apple Style
   ======================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--apple-space-3, 12px);
    padding: var(--apple-space-4, 16px) var(--apple-space-5, 20px);
    border-radius: var(--apple-radius-lg, 16px);
    font-size: var(--apple-text-base, 15px);
    line-height: 1.5;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: var(--apple-weight-semibold, 600);
    margin-bottom: var(--apple-space-1, 4px);
}

.alert-info {
    background: var(--apple-blue-light, rgba(0, 122, 255, 0.1));
    color: var(--apple-gray-900, #1d1d1f);
}

.alert-info .alert-icon,
.alert-info .alert-title {
    color: var(--apple-blue, #007aff);
}

.alert-success {
    background: var(--apple-green-light, rgba(52, 199, 89, 0.12));
    color: var(--apple-gray-900, #1d1d1f);
}

.alert-success .alert-icon,
.alert-success .alert-title {
    color: var(--apple-green, #34c759);
}

.alert-warning {
    background: var(--apple-orange-light, rgba(255, 149, 0, 0.12));
    color: var(--apple-gray-900, #1d1d1f);
}

.alert-warning .alert-icon,
.alert-warning .alert-title {
    color: var(--apple-orange, #ff9500);
}

.alert-error {
    background: var(--apple-red-light, rgba(255, 59, 48, 0.12));
    color: var(--apple-gray-900, #1d1d1f);
}

.alert-error .alert-icon,
.alert-error .alert-title {
    color: var(--apple-red, #ff3b30);
}

/* ========================================
   PROGRESS BAR - Apple Style
   ======================================== */

.progress {
    height: 6px;
    background: var(--apple-gray-200, #e8e8ed);
    border-radius: var(--apple-radius-full, 9999px);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--apple-blue, #007aff);
    border-radius: var(--apple-radius-full, 9999px);
    transition: width var(--apple-duration-slow, 0.4s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
}

.progress-bar.success {
    background: var(--apple-green, #34c759);
}

.progress-bar.warning {
    background: var(--apple-orange, #ff9500);
}

.progress-bar.danger {
    background: var(--apple-red, #ff3b30);
}

/* ========================================
   AVATAR - Apple Style
   ======================================== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--apple-radius-full, 9999px);
    background: var(--apple-gray-200, #e8e8ed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--apple-weight-semibold, 600);
    color: var(--apple-gray-600, #636366);
    font-size: var(--apple-text-sm, 13px);
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--apple-text-xs, 11px);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--apple-text-md, 17px);
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: var(--apple-text-xl, 24px);
}

/* Avatar Group */
.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid var(--apple-white, #ffffff);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========================================
   TABS - Apple Style
   ======================================== */

.tabs {
    display: flex;
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
    gap: var(--apple-space-1, 4px);
}

.tab {
    padding: var(--apple-space-3, 12px) var(--apple-space-4, 16px);
    font-size: var(--apple-text-base, 15px);
    font-weight: var(--apple-weight-medium, 500);
    color: var(--apple-gray-500, #8e8e93);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
    margin-bottom: -0.5px;
}

.tab:hover {
    color: var(--apple-gray-900, #1d1d1f);
}

.tab.active {
    color: var(--apple-blue, #007aff);
    border-bottom-color: var(--apple-blue, #007aff);
}

.tab-content {
    padding: var(--apple-space-5, 20px) 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ========================================
   TOOLTIP - Apple Style
   ======================================== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: var(--apple-space-2, 8px) var(--apple-space-3, 12px);
    background: var(--apple-gray-800, #3a3a3c);
    color: var(--apple-white, #ffffff);
    font-size: var(--apple-text-sm, 13px);
    font-weight: var(--apple-weight-medium, 500);
    border-radius: var(--apple-radius-sm, 8px);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--apple-duration-fast, 0.15s) var(--apple-ease, cubic-bezier(0.25, 0.1, 0.25, 1));
    pointer-events: none;
    z-index: 800;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ========================================
   LEGACY COMPATIBILITY
   Map old variable names to new Apple design tokens
   ======================================== */

:root {
    /* Map old variables to new Apple design tokens */
    --white: var(--apple-white);
    --gray-50: var(--apple-gray-50);
    --gray-100: var(--apple-gray-100);
    --gray-200: var(--apple-gray-200);
    --gray-300: var(--apple-gray-300);
    --gray-400: var(--apple-gray-400);
    --gray-500: var(--apple-gray-500);
    --gray-600: var(--apple-gray-600);
    --gray-900: var(--apple-gray-900);
    --black: var(--apple-black);
    
    --blue: var(--apple-blue);
    --blue-hover: var(--apple-blue-hover);
    --blue-light: var(--apple-blue-light);
    
    --green: var(--apple-green);
    --green-light: var(--apple-green-light);
    --orange: var(--apple-orange);
    --orange-light: var(--apple-orange-light);
    --red: var(--apple-red);
    --red-light: var(--apple-red-light);
    --purple: var(--apple-purple);
    --purple-light: var(--apple-purple-light);
    
    --font-family: var(--apple-font);
    
    --radius-sm: var(--apple-radius-sm);
    --radius-md: var(--apple-radius-md);
    --radius-lg: var(--apple-radius-lg);
    --radius-xl: var(--apple-radius-xl);
    --radius-full: var(--apple-radius-full);
    
    --shadow-sm: var(--apple-shadow-sm);
    --shadow-md: var(--apple-shadow-md);
    --shadow-lg: var(--apple-shadow-lg);
    
    --transition-fast: var(--apple-duration-fast) var(--apple-ease);
    --transition-medium: var(--apple-duration-normal) var(--apple-ease);
}

/* ========================================
   RESPONSIVE HELPERS
   ======================================== */

@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: var(--apple-space-3, 12px);
        padding: var(--apple-space-4, 16px);
    }
    
    .calendar-title {
        min-width: auto;
        font-size: var(--apple-text-md, 17px);
    }
    
    .calendar-month-day {
        min-height: 70px;
        padding: var(--apple-space-1, 4px);
    }
    
    .calendar-month-day-number {
        font-size: var(--apple-text-xs, 11px);
        width: 22px;
        height: 22px;
    }
    
    .calendar-month-event {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .service-card {
        padding: var(--apple-space-4, 16px);
    }
}

/* ========================================
   DASHBOARD CALENDAR - Apple Calendar Style Override
   ======================================== */

/* View selector as Apple segmented control */
.view-selector {
    display: flex;
    background: var(--apple-gray-200, #e8e8ed);
    border-radius: var(--apple-radius-md, 12px);
    padding: 3px;
    gap: 2px;
}

.view-selector select {
    display: none; /* Hide default select */
}

.view-selector .view-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--apple-gray-600, #636366);
    background: transparent;
    border: none;
    border-radius: var(--apple-radius-sm, 8px);
    cursor: pointer;
    transition: all 0.15s var(--apple-ease);
}

.view-selector .view-btn:hover {
    color: var(--apple-gray-900, #1d1d1f);
}

.view-selector .view-btn.active {
    background: var(--apple-white, #ffffff);
    color: var(--apple-gray-900, #1d1d1f);
    box-shadow: var(--apple-shadow-xs);
}

/* Week/Day view improvements */
.week-view, .day-view {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-lg, 16px);
    overflow: hidden;
}

.week-header, .day-header {
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.week-header-cell {
    padding: 12px 4px;
    text-align: center;
    border-left: 0.5px solid var(--apple-gray-100, #f5f5f7);
}

.week-header-cell:first-child {
    border-left: none;
}

.week-header-day {
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-gray-500, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.week-header-date {
    font-size: 20px;
    font-weight: 500;
    color: var(--apple-gray-900, #1d1d1f);
}

.week-header-cell.today .week-header-date {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.week-grid {
    background: var(--apple-white, #ffffff);
}

.week-time-slot {
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
    border-right: 0.5px solid var(--apple-gray-200, #e8e8ed);
    font-size: 11px;
    color: var(--apple-gray-500, #8e8e93);
    padding: 0 8px;
    text-align: right;
}

.week-day-slot {
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
    border-left: 0.5px solid var(--apple-gray-100, #f5f5f7);
    background: var(--apple-white, #ffffff);
    transition: background 0.15s var(--apple-ease);
}

.week-day-slot:hover {
    background: var(--apple-blue-subtle, rgba(0, 122, 255, 0.05));
}

.week-day-slot.drag-over {
    background: var(--apple-blue-light, rgba(0, 122, 255, 0.12));
    box-shadow: inset 0 0 0 2px var(--apple-blue, #007aff);
}

/* Month view improvements */
.month-view {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-lg, 16px);
    overflow: hidden;
}

.month-header {
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.month-header-cell {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-gray-500, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-day {
    border-right: 0.5px solid var(--apple-gray-100, #f5f5f7);
    border-bottom: 0.5px solid var(--apple-gray-100, #f5f5f7);
    background: var(--apple-white, #ffffff);
    padding: 8px;
    min-height: 80px;
    transition: background 0.15s var(--apple-ease);
}

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

.month-day:hover {
    background: var(--apple-gray-50, #fbfbfd);
}

.month-day.other-month {
    background: var(--apple-gray-50, #fbfbfd);
}

.month-day.other-month .month-day-number {
    color: var(--apple-gray-400, #aeaeb2);
}

.month-day-number {
    font-size: 13px;
    font-weight: 500;
    color: var(--apple-gray-900, #1d1d1f);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px;
}

.month-day.today .month-day-number {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
}

.month-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.month-event {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s var(--apple-ease);
}

.month-event:hover {
    opacity: 0.9;
}

/* Calendar events - Apple style */
.calendar-event {
    background: var(--apple-blue, #007aff);
    color: var(--apple-white, #ffffff);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
    cursor: grab;
    transition: all 0.15s var(--apple-ease);
    overflow: hidden;
    line-height: 1.3;
}

.calendar-event:hover {
    opacity: 0.9;
    transform: scale(1.01);
}

.calendar-event.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: var(--apple-shadow-lg);
}

.calendar-event-time {
    font-size: 10px;
    opacity: 0.9;
}

/* Time label */
.time-label {
    background: var(--apple-gray-50, #fbfbfd);
    border-right: 0.5px solid var(--apple-gray-200, #e8e8ed);
    font-size: 11px;
    color: var(--apple-gray-500, #8e8e93);
    padding: 2px 8px;
    text-align: right;
}

/* Right panel - Today & Upcoming */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.today-card, .upcoming-card {
    background: var(--apple-white, #ffffff);
    border-radius: var(--apple-radius-lg, 16px);
    border: 0.5px solid var(--apple-gray-200, #e8e8ed);
    overflow: hidden;
    box-shadow: var(--apple-shadow-xs);
}

.panel-header {
    padding: 14px 16px;
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-gray-600, #636366);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    padding: 12px;
}

.event-item {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--apple-gray-50, #fbfbfd);
    border-left: 3px solid var(--apple-blue, #007aff);
    transition: all 0.2s var(--apple-ease);
    cursor: pointer;
}

.event-item:hover {
    background: var(--apple-white, #ffffff);
    box-shadow: var(--apple-shadow-sm);
    transform: translateX(2px);
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-gray-900, #1d1d1f);
    margin-bottom: 4px;
}

.event-item-time {
    font-size: 12px;
    color: var(--apple-gray-600, #636366);
}

.event-item-location {
    font-size: 12px;
    color: var(--apple-gray-500, #8e8e93);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Calendar toolbar - Apple style */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--apple-gray-50, #fbfbfd);
    border-bottom: 0.5px solid var(--apple-gray-200, #e8e8ed);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--apple-white, #ffffff);
    border: 0.5px solid var(--apple-gray-200, #e8e8ed);
    color: var(--apple-gray-600, #636366);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s var(--apple-ease);
}

.btn-nav:hover {
    background: var(--apple-gray-100, #f5f5f7);
    border-color: var(--apple-gray-300, #d2d2d7);
}

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

.current-date {
    font-size: 17px;
    font-weight: 600;
    color: var(--apple-gray-900, #1d1d1f);
    min-width: 180px;
    text-align: center;
}

.btn-today {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--apple-blue, #007aff);
    background: transparent;
    border: none;
    border-radius: var(--apple-radius-sm, 8px);
    cursor: pointer;
    transition: all 0.15s var(--apple-ease);
}

.btn-today:hover {
    background: var(--apple-blue-subtle, rgba(0, 122, 255, 0.08));
}

.btn-sync {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--apple-gray-700, #424245);
    background: var(--apple-white, #ffffff);
    border: 0.5px solid var(--apple-gray-200, #e8e8ed);
    border-radius: var(--apple-radius-md, 12px);
    cursor: pointer;
    transition: all 0.15s var(--apple-ease);
}

.btn-sync:hover {
    background: var(--apple-gray-100, #f5f5f7);
    border-color: var(--apple-gray-300, #d2d2d7);
}

.btn-sync.syncing {
    color: var(--apple-blue, #007aff);
}

.btn-sync.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.btn-sync.success {
    background: var(--apple-green-light, rgba(52, 199, 89, 0.12));
    border-color: var(--apple-green, #34c759);
    color: var(--apple-green, #34c759);
}

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

/* ========================================
   iOS TAB BAR - Mobile Only Navigation
   ======================================== */

.ios-tab-bar {
    display: none; /* Hidden by default (desktop) */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--apple-gray-200, #e8e8ed);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    z-index: 1000;
}

.ios-tab-bar {
    display: none; /* Hidden on desktop */
    justify-content: space-around;
    align-items: center;
}

.ios-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    color: var(--apple-gray-500, #8e8e93);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ios-tab-item:hover,
.ios-tab-item.active {
    color: var(--apple-blue, #007aff);
}

.ios-tab-icon {
    width: 24px;
    height: 24px;
}

.ios-tab-label {
    font-size: 10px;
}

/* Show iOS tab bar only on mobile/tablet */
@media (max-width: 768px) {
    .ios-tab-bar {
        display: flex;
    }
    
    /* Add padding to body to prevent content from being hidden behind tab bar */
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
    }
    
    /* Hide desktop nav on mobile */
    .nav {
        display: none;
    }
}
