/**
 * Calendar & Availability Section Styles
 * Combines calendar integrations and availability settings
 */

/* Header */
.cal-avail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.cal-avail-header .header-content {
    flex: 1;
}

.cal-avail-header .header-actions {
    display: flex;
    gap: 12px;
}

.cal-avail-header .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cal-avail-header .btn-secondary:hover {
    background: var(--color-surface-subtle);
    border-color: #cbd5e1;
}

.cal-avail-header .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1E3A5F;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cal-avail-header .btn-primary:hover {
    background: #152C4A;
}

/* Calendar Integrations Cards */
.cal-avail-integrations {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.integration-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all 0.2s;
}

.integration-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.integration-card.connected {
    border-color: #10b981;
    background: #f0fdf4;
}

.integration-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.integration-icon.google {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.integration-icon.google i {
    background: linear-gradient(135deg, #4285f4 25%, #ea4335 25%, #ea4335 50%, #fbbc05 50%, #fbbc05 75%, #34a853 75%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.integration-icon.outlook {
    background: #0078d4;
    color: white;
}

.integration-icon.apple {
    background: #000;
    color: white;
}

.integration-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.integration-info .integration-email {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.integration-status {
    margin-top: auto;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.connected {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.disconnected {
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
}

.status-badge.syncing {
    background: #fef3c7;
    color: #d97706;
}

.btn-connect {
    padding: 8px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-connect:hover {
    background: var(--color-surface-subtle);
    border-color: #1E3A5F;
    color: #1E3A5F;
}

.btn-disconnect {
    padding: 8px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-disconnect:hover {
    background: #fee2e2;
}

/* Unified Calendar */
.cal-avail-calendar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.cal-avail-calendar .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cal-avail-calendar .calendar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggle {
    display: flex;
    background: var(--color-surface-subtle);
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--color-surface);
    color: var(--color-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text-primary);
}

.current-period {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    min-width: 100px;
    text-align: center;
}

.today-btn {
    padding: 6px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.today-btn:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text-primary);
}

/* Calendar Grid */
.calendar-grid {
    min-height: 200px;
    overflow-x: auto; /* Allow horizontal scroll on small screens */
}

.calendar-week {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 1px;
    background: var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    min-width: 700px; /* Prevent days from stacking vertically */
    width: 100%;
}

/* Ensure unified calendar week view stays horizontal */
.unified-calendar-grid.view-week {
    overflow-x: auto;
}

.unified-calendar-grid.view-week .calendar-week {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    min-width: 700px;
}

.unified-calendar-grid.view-week .calendar-day {
    min-width: 0; /* Allow flex shrinking */
}

.calendar-day-header {
    background: var(--color-surface-subtle);
    padding: 12px 8px;
    text-align: center;
}

.calendar-day-header .day-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day-header .day-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 4px;
}

.calendar-day-header.today .day-number {
    background: #1E3A5F;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.calendar-day-cell {
    background: var(--color-surface);
    min-height: 80px;
    padding: 8px;
}

.calendar-event {
    background: #1E3A5F;
    color: #ffffff !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event * {
    color: #ffffff !important;
}

.calendar-event.google {
    background: #4285f4;
}

.calendar-event.outlook {
    background: #0078d4;
}

.calendar-event.apple {
    background: #000;
}

.calendar-event .event-time {
    font-size: 10px;
    opacity: 0.85;
    font-weight: 400;
}

.calendar-event .event-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Month View Styles */
.unified-calendar-grid.view-month {
    min-height: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.calendar-month-grid {
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    min-width: 100%;
}

.calendar-month-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(45px, 1fr));
    background: var(--color-surface-subtle);
    border-bottom: 1px solid var(--color-border);
}

.month-day-name {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.calendar-month-body {
    display: flex;
    flex-direction: column;
}

.calendar-month-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(45px, 1fr));
    border-bottom: 1px solid var(--color-border);
}

.calendar-month-row:last-child {
    border-bottom: none;
}

.calendar-month-cell {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: background 0.2s;
    min-width: 0; /* Allow cell to shrink */
}

.calendar-month-cell:last-child {
    border-right: none;
}

.calendar-month-cell:hover {
    background: var(--color-surface-subtle);
}

.calendar-month-cell.other-month {
    background: var(--color-surface-subtle);
}

.calendar-month-cell.other-month .month-cell-date {
    color: #cbd5e1;
}

.calendar-month-cell.today {
    background: #EBF0F7;
}

.calendar-month-cell.today .month-cell-date {
    background: #1E3A5F;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-cell-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

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

.month-event {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    background: #1E3A5F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.month-event.google {
    background: #4285f4;
}

.month-event.outlook {
    background: #0078d4;
}

.month-event.apple {
    background: #000;
}

.month-event-more {
    font-size: 10px;
    color: var(--color-text-secondary);
    padding: 2px 0;
}

/* Day View Styles */
.unified-calendar-grid.view-day {
    min-height: auto;
}

.calendar-day-view {
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
}

.day-view-header {
    padding: 20px;
    background: var(--color-surface-subtle);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.day-view-header.today {
    background: linear-gradient(135deg, #EBF0F7 0%, #f0f9ff 100%);
}

.day-view-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.day-view-date {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.day-view-events {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.day-event {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-surface-subtle);
    border-radius: 8px;
    border-left: 4px solid #1E3A5F;
}

.day-event.google {
    border-left-color: #4285f4;
}

.day-event.outlook {
    border-left-color: #0078d4;
}

.day-event.apple {
    border-left-color: #000;
}

.day-event-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 80px;
}

.day-event-details {
    flex: 1;
}

.day-event-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.day-event-location {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.day-event-location i {
    margin-right: 4px;
}

.day-view-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

.day-view-empty i {
    font-size: 32px;
    margin-bottom: 12px;
}

.day-view-empty p {
    margin: 0;
    font-size: 14px;
}

/* Availability Settings */
.cal-avail-settings {
    margin-bottom: 24px;
}

.cal-avail-settings > h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.availability-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

/* Working Hours Card */
.working-hours-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.working-hours-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.working-hours-header h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.working-hours-header p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.timezone-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--color-surface-subtle);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.timezone-badge i {
    font-size: 12px;
    color: #94a3b8;
}

/* Working Hours List */
.working-hours-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wh-day-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.wh-day-row:last-child {
    border-bottom: none;
}

.wh-day-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 160px;
}

.wh-day-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.wh-day-row.disabled .wh-day-name {
    color: #94a3b8;
}

/* Toggle Switch */
.wh-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.wh-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wh-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: 0.3s;
    border-radius: 28px;
}

.wh-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wh-toggle input:checked + .wh-toggle-slider {
    background-color: #1E3A5F;
}

.wh-toggle input:checked + .wh-toggle-slider:before {
    transform: translateX(24px);
}

/* Time Slots */
.wh-time-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.wh-unavailable {
    font-size: 14px;
    color: #94a3b8;
    font-style: normal;
}

.wh-time-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.wh-slot-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 4px;
}

.wh-slot-remove-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.wh-time-btn {
    padding: 8px 16px;
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.wh-time-btn:hover {
    background: var(--color-border);
    border-color: #cbd5e1;
}

.wh-time-separator {
    color: #94a3b8;
    font-size: 14px;
}

.wh-time-hidden {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* Actions */
.wh-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.wh-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #1E3A5F;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.wh-add-btn:hover {
    background: #152d4a;
    transform: scale(1.05);
}

.wh-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.wh-delete-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Working Hours Footer */
.working-hours-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.wh-sync-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.wh-sync-btn:hover {
    background: #f6f8fa;
    border-color: #8b949e;
}

.wh-sync-btn i {
    font-size: 13px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--color-surface);
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #1E3A5F;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.day-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.day-row.disabled .day-name {
    color: #94a3b8;
}

.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface-subtle);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.time-slot input[type="time"] {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: 500;
}

.time-slot .separator {
    color: #94a3b8;
}

.add-slot-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.add-slot-btn:hover {
    border-color: #1E3A5F;
    color: #1E3A5F;
}

.day-row.disabled .time-slots {
    opacity: 0.5;
    pointer-events: none;
}

/* Custom Rules Card */
.custom-rules-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
}

.custom-rules-card .card-header h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rule-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rule-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.rule-item select {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-surface);
    cursor: pointer;
}

.rule-item select:focus {
    outline: none;
    border-color: #1E3A5F;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-secondary.btn-full {
    padding: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary.btn-full:hover {
    background: var(--color-surface-subtle);
    border-color: #1E3A5F;
    color: #1E3A5F;
}

/* Pro Tip */
.pro-tip {
    background: #EBF0F7;
    border: 1px solid #2A4F7A;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

[data-theme="dark"] .pro-tip {
    background: rgba(30, 58, 95, 0.2);
    border-color: rgba(42, 79, 122, 0.4);
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1E3A5F, #0F2440);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pro-tip p {
    margin: 0;
    font-size: 13px;
    color: #1E3A5F;
    line-height: 1.5;
}

[data-theme="dark"] .pro-tip p {
    color: var(--color-text-secondary);
}

/* Multi-Calendar Sync Info */
.cal-avail-info {
    background: linear-gradient(135deg, #EBF0F7 0%, #D6E1F0 100%);
    border: 1px solid #2A4F7A;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.info-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1E3A5F, #0F2440);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}

.info-content h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.info-steps {
    display: flex;
    gap: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-num {
    width: 24px;
    height: 24px;
    background: #1E3A5F;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step span:last-child {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .availability-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .cal-avail-integrations {
        grid-template-columns: 1fr;
    }

    .cal-avail-header {
        flex-direction: column;
        gap: 16px;
    }

    .info-steps {
        flex-direction: column;
        gap: 12px;
    }

    .cal-avail-info {
        flex-direction: column;
        text-align: center;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    /* Page Header */
    .cal-avail-header {
        padding: 0;
    }

    .cal-avail-header .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .cal-avail-header .header-actions .btn-secondary,
    .cal-avail-header .header-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Calendar Card */
    .cal-avail-calendar {
        padding: 16px;
        border-radius: 8px;
    }

    .cal-avail-calendar .calendar-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .cal-avail-calendar .calendar-header h3 {
        text-align: center;
    }

    .calendar-controls {
        flex-direction: column;
        gap: 12px;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .calendar-nav {
        justify-content: center;
        width: 100%;
    }

    .today-btn {
        width: 100%;
        text-align: center;
    }

    /* ========================================
       WEEK VIEW - Tablet/Mobile
       ======================================== */
    .unified-calendar-grid.view-week {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .unified-calendar-grid.view-week .calendar-week {
        min-width: 600px;
    }

    .calendar-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-week {
        min-width: 600px;
    }

    /* ========================================
       MONTH VIEW - Tablet/Mobile
       Fit to screen width - no horizontal scroll!
       ======================================== */
    .unified-calendar-grid.view-month {
        overflow-x: visible;
        overflow: visible;
    }

    .calendar-month-grid {
        min-width: 100%;
        width: 100%;
    }

    .calendar-month-header {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-month-row {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-month-cell {
        min-height: 70px;
        padding: 4px;
    }

    .month-day-name {
        padding: 8px 2px;
        font-size: 10px;
    }

    .month-cell-date {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .calendar-month-cell.today .month-cell-date {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .month-event {
        font-size: 8px;
        padding: 1px 3px;
        border-radius: 2px;
    }

    .month-cell-events {
        gap: 1px;
    }

    .month-event-more {
        font-size: 8px;
    }

    /* ========================================
       DAY VIEW - Tablet/Mobile (No scroll needed)
       ======================================== */
    .unified-calendar-grid.view-day {
        overflow: visible;
    }

    .calendar-day-view {
        border-radius: 8px;
    }

    .day-view-header {
        padding: 16px;
    }

    .day-view-name {
        font-size: 16px;
    }

    .day-view-date {
        font-size: 13px;
    }

    .day-view-events {
        padding: 12px;
        gap: 10px;
    }

    .day-event {
        padding: 12px;
        gap: 12px;
    }

    .day-event-time {
        min-width: 70px;
        font-size: 12px;
    }

    .day-event-title {
        font-size: 13px;
    }

    .day-event-location {
        font-size: 11px;
    }

    /* Working Hours Card */
    .working-hours-card {
        padding: 16px;
        border-radius: 12px;
    }

    .working-hours-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }

    .working-hours-header h3 {
        font-size: 16px;
    }

    .timezone-badge {
        width: 100%;
        justify-content: center;
    }

    /* Working Hours Row - Stack vertically */
    .wh-day-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0;
    }

    .wh-day-toggle {
        width: 100%;
        justify-content: space-between;
        min-width: unset;
    }

    .wh-time-slots {
        width: 100%;
        padding-left: 0;
    }

    .wh-time-slot {
        flex-wrap: wrap;
        width: 100%;
    }

    .wh-time-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .wh-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        margin-top: 8px;
    }

    /* Custom Rules Card */
    .custom-rules-card {
        padding: 16px;
    }

    /* Info Box */
    .cal-avail-info {
        padding: 16px;
    }

    .info-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    /* Integration Cards */
    .integration-card {
        padding: 16px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    /* Page Title */
    #calendar-availability-section .page-header .page-title {
        font-size: 20px;
    }

    #calendar-availability-section .page-header .page-subtitle {
        font-size: 13px;
    }

    /* Calendar Controls */
    .view-toggle {
        padding: 2px;
    }

    .view-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nav-btn {
        width: 28px;
        height: 28px;
    }

    .current-period {
        font-size: 13px;
        min-width: 80px;
    }

    /* ========================================
       WEEK VIEW - Mobile Phone
       ======================================== */
    .unified-calendar-grid.view-week .calendar-week {
        min-width: 500px;
    }

    .calendar-week {
        min-width: 500px;
    }

    .calendar-day-header {
        padding: 8px 4px;
    }

    .calendar-day-header .day-name {
        font-size: 10px;
        letter-spacing: 0;
    }

    .calendar-day-header .day-number {
        font-size: 16px;
    }

    .calendar-day-header.today .day-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .calendar-day-cell {
        padding: 4px;
        min-height: 60px;
    }

    .calendar-event {
        padding: 2px 4px;
        font-size: 10px;
    }

    .calendar-event .event-time {
        font-size: 9px;
    }

    .calendar-event .event-title {
        font-size: 10px;
    }

    /* ========================================
       MONTH VIEW - Mobile Phone
       Compact fit - no scroll needed!
       ======================================== */
    .unified-calendar-grid.view-month {
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .calendar-month-grid {
        min-width: 100%;
        width: 100%;
        border-radius: 6px;
    }

    .calendar-month-header {
        grid-template-columns: repeat(7, 1fr);
    }

    .month-day-name {
        padding: 6px 1px;
        font-size: 9px;
        letter-spacing: -0.3px;
    }

    .calendar-month-row {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-month-cell {
        min-height: 55px;
        padding: 3px;
    }

    .month-cell-date {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .calendar-month-cell.today .month-cell-date {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    /* Mobile month events - clean simple indicator */
    .month-cell-events {
        gap: 2px;
    }

    /* Show only first event as small truncated pill */
    .month-event {
        font-size: 9px;
        padding: 2px 4px;
        border-radius: 2px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide events after the first one */
    .month-event:nth-child(n+2) {
        display: none;
    }

    /* Show +more count inline */
    .month-event-more {
        font-size: 8px;
        color: var(--color-text-secondary);
        padding: 0;
        margin-top: 1px;
    }

    /* ========================================
       DAY VIEW - Mobile Phone (Best on mobile!)
       ======================================== */
    .unified-calendar-grid.view-day {
        overflow: visible;
    }

    .calendar-day-view {
        border-radius: 8px;
    }

    .day-view-header {
        padding: 14px;
    }

    .day-view-name {
        font-size: 15px;
    }

    .day-view-date {
        font-size: 12px;
        margin-top: 2px;
    }

    .day-view-events {
        padding: 10px;
        gap: 8px;
        min-height: 150px;
    }

    /* Stack time and details vertically on mobile */
    .day-event {
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
        border-left-width: 3px;
    }

    .day-event-time {
        font-size: 11px;
        min-width: unset;
        color: #1E3A5F;
        font-weight: 600;
    }

    .day-event.google .day-event-time {
        color: #4285f4;
    }

    .day-event.outlook .day-event-time {
        color: #0078d4;
    }

    .day-event.apple .day-event-time {
        color: #000;
    }

    .day-event-details {
        width: 100%;
    }

    .day-event-title {
        font-size: 13px;
        line-height: 1.3;
    }

    .day-event-location {
        font-size: 11px;
        margin-top: 3px;
    }

    .day-view-empty {
        padding: 30px 20px;
    }

    .day-view-empty i {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .day-view-empty p {
        font-size: 13px;
    }

    /* Working Hours - Full mobile layout */
    .working-hours-card {
        padding: 12px;
    }

    .working-hours-header h3 {
        font-size: 15px;
    }

    .working-hours-header p {
        font-size: 12px;
    }

    .timezone-badge {
        padding: 6px 12px;
        font-size: 12px;
    }

    .wh-day-row {
        padding: 12px 0;
    }

    .wh-day-name {
        font-size: 14px;
    }

    .wh-toggle {
        width: 44px;
        height: 24px;
    }

    .wh-toggle-slider:before {
        height: 18px;
        width: 18px;
    }

    .wh-toggle input:checked + .wh-toggle-slider:before {
        transform: translateX(20px);
    }

    .wh-time-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .wh-time-separator {
        font-size: 12px;
    }

    .wh-add-btn,
    .wh-delete-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .wh-unavailable {
        font-size: 13px;
    }

    /* Working Hours Footer */
    .working-hours-footer {
        margin-top: 16px;
        padding-top: 12px;
    }

    .wh-sync-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    /* Custom Rules */
    .rule-item label {
        font-size: 12px;
    }

    .rule-item select {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Pro Tip */
    .pro-tip {
        padding: 12px;
    }

    .pro-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .pro-tip p {
        font-size: 12px;
    }

    /* Info Box */
    .cal-avail-info {
        padding: 12px;
        gap: 16px;
    }

    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 8px;
    }

    .info-content h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .step-num {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .step span:last-child {
        font-size: 12px;
    }

    /* Integration Cards */
    .integration-card {
        padding: 12px;
        gap: 8px;
    }

    .integration-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .integration-info h4 {
        font-size: 13px;
    }

    .integration-info .integration-email {
        font-size: 11px;
    }

    .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .btn-connect,
    .btn-disconnect {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Month View Mobile */
    .calendar-month-cell {
        min-height: 70px;
        padding: 4px;
    }

    .month-cell-date {
        font-size: 12px;
    }

    .month-event {
        font-size: 9px;
        padding: 1px 4px;
    }

    /* Day View Mobile */
    .day-view-header {
        padding: 16px;
    }

    .day-view-name {
        font-size: 16px;
    }

    .day-view-date {
        font-size: 13px;
    }

    .day-event {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }

    .day-event-time {
        font-size: 12px;
        min-width: unset;
    }

    .day-event-title {
        font-size: 13px;
    }

    .day-event-location {
        font-size: 11px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .working-hours-card {
        padding: 10px;
    }

    .wh-day-toggle {
        gap: 8px;
    }

    .wh-day-name {
        font-size: 13px;
    }

    .wh-time-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .view-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* Week View - Extra small */
    .unified-calendar-grid.view-week .calendar-week,
    .calendar-week {
        min-width: 400px;
    }

    .calendar-day-header .day-name {
        font-size: 9px;
    }

    .calendar-day-header .day-number {
        font-size: 14px;
    }

    /* Month View - Extra small - fits screen! */
    .calendar-month-grid {
        min-width: 100%;
    }

    .month-day-name {
        font-size: 8px;
        padding: 5px 0;
        letter-spacing: -0.5px;
    }

    .calendar-month-cell {
        min-height: 48px;
        padding: 2px;
    }

    .month-cell-date {
        font-size: 10px;
    }

    .calendar-month-cell.today .month-cell-date {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    /* Extra small: show event as tiny pill */
    .month-event {
        font-size: 8px;
        padding: 1px 3px;
    }

    .month-event-more {
        font-size: 7px;
    }

    /* Day View - Extra small */
    .day-view-header {
        padding: 12px;
    }

    .day-view-name {
        font-size: 14px;
    }

    .day-view-date {
        font-size: 11px;
    }

    .day-event {
        padding: 8px 10px;
    }

    .day-event-time {
        font-size: 10px;
    }

    .day-event-title {
        font-size: 12px;
    }

    .day-event-location {
        font-size: 10px;
    }
}

/* ========================================
   HORIZONTAL SCROLL INDICATOR (Week View only)
   Visual hint that content is scrollable
   ======================================== */
@media (max-width: 768px) {
    .unified-calendar-grid.view-week::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .unified-calendar-grid.view-week:not(:hover)::after {
        opacity: 1;
    }

    .unified-calendar-grid.view-week {
        position: relative;
    }
}

/* ========================================
   DAY & MONTH VIEW - No scroll needed on mobile
   ======================================== */
@media (max-width: 480px) {
    /* Month view fits screen - no scroll */
    .unified-calendar-grid.view-month {
        overflow: visible;
        padding-bottom: 0;
    }

    /* Day view fits screen - no scroll */
    .unified-calendar-grid.view-day {
        overflow: visible;
        padding-bottom: 0;
    }
}

/* ========================================
   DARK MODE: Calendar & Availability
   ======================================== */

/* Multi-Calendar Sync banner */
[data-theme="dark"] .cal-avail-info {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.25) 0%, rgba(15, 36, 64, 0.3) 100%);
    border-color: rgba(42, 79, 122, 0.4);
}

/* Toggle slider unchecked state */
[data-theme="dark"] .wh-toggle-slider {
    background-color: var(--color-border);
}

/* Sync button hover */
[data-theme="dark"] .wh-sync-btn:hover {
    background: var(--color-surface-subtle);
    border-color: var(--color-text-muted);
}

/* Delete/remove button hover */
[data-theme="dark"] .wh-delete-btn:hover,
[data-theme="dark"] .wh-slot-remove-btn:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Disabled day name */
[data-theme="dark"] .wh-day-row.disabled .wh-day-name,
[data-theme="dark"] .wh-unavailable {
    color: var(--color-text-muted);
}

/* Time separator */
[data-theme="dark"] .wh-time-separator {
    color: var(--color-text-muted);
}

/* Timezone badge icon */
[data-theme="dark"] .timezone-badge i {
    color: var(--color-text-muted);
}
