/* Stone Circle Styles - Nature-inspired, calm design for distributed teams */

:root {
    /* Stone Gray Theme (default) */
    --stone-primary: #6d7278;
    --stone-light: #9a9ea3;
    --stone-dark: #4a4f54;
    --stone-bg: #f7f8f9;

    /* Earth Brown Theme */
    --earth-primary: #7d6a5a;
    --earth-light: #a58f7f;
    --earth-dark: #5a4a3d;
    --earth-bg: #f8f6f5;

    /* Water Blue Theme */
    --water-primary: #5a7d8d;
    --water-light: #7fa5b5;
    --water-dark: #3d5a67;
    --water-bg: #f5f8fa;

    /* Forest Green Theme */
    --forest-primary: #5a7d5a;
    --forest-light: #7fa57f;
    --forest-dark: #3d5a3d;
    --forest-bg: #f5f8f5;

    /* Default to Stone Gray */
    --primary-color: var(--stone-primary);
    --primary-light: var(--stone-light);
    --primary-dark: var(--stone-dark);
    --bg-color: var(--stone-bg);

    /* Neutral colors - Light Mode */
    --white: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #95a5a6;
    --border-color: #e8eaed;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 8px -2px rgba(0, 0, 0, 0.08);

    /* Status colors */
    --status-available: #27ae60;
    --status-maybe: #f39c12;
    --status-offline: #95a5a6;

    /* Status background/text colors for comparison view */
    --status-available-bg: #d4edda;
    --status-available-text: #155724;
    --status-maybe-bg: #fff3cd;
    --status-maybe-text: #856404;
    --status-offline-bg: #e2e3e5;
    --status-offline-text: #383d41;

    /* Spacing */
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.625rem;
    --spacing-md: 0.875rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
    --spacing-2xl: 1.5rem;
    --card-padding: 0.875rem;

    /* Typography */
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --line-height: 1.5;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 9px;

    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-normal: 300ms ease;

    /* Safe area insets for notched devices (iPhone X+, modern Android) */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

/* Theme Selectors */
:root[data-theme="earth"] {
    --primary-color: var(--earth-primary);
    --primary-light: var(--earth-light);
    --primary-dark: var(--earth-dark);
    --bg-color: var(--earth-bg);
}

:root[data-theme="water"] {
    --primary-color: var(--water-primary);
    --primary-light: var(--water-light);
    --primary-dark: var(--water-dark);
    --bg-color: var(--water-bg);
}

:root[data-theme="forest"] {
    --primary-color: var(--forest-primary);
    --primary-light: var(--forest-light);
    --primary-dark: var(--forest-dark);
    --bg-color: var(--forest-bg);
}

/* Dark Mode */
:root[data-dark-mode="true"] {
    --white: #1a1d1f;
    --text-primary: #e8eaed;
    --text-secondary: #b8bbbe;
    --text-muted: #7a7e82;
    --border-color: #3a3d3f;
    --bg-color: #0f1214;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8), 0 4px 6px -2px rgba(0, 0, 0, 0.6);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-body);
    line-height: var(--line-height);
    color: var(--text-primary);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    line-height: 1.2;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-top: calc(var(--spacing-md) + var(--safe-area-inset-top));
    padding-left: calc(var(--spacing-lg) + var(--safe-area-inset-left));
    padding-right: calc(var(--spacing-lg) + var(--safe-area-inset-right));
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.app-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: transparent;
    mix-blend-mode: multiply;
    opacity: 0.9;
}

:root[data-dark-mode="true"] .app-logo {
    mix-blend-mode: screen;
    opacity: 0.8;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin: 0;
}

.app-tagline {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
    animation: fadeIn 0.6s ease;
}

.welcome-icon {
    margin-bottom: var(--spacing-lg);
    animation: gentlePulse 3s ease-in-out infinite;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
}

.welcome-title {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.welcome-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Team View */
.team-view {
    animation: fadeIn 0.4s ease;
}

/* Search Bar */
.search-bar {
    margin-bottom: var(--spacing-md);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 75px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    font-family: var(--font-family-body);
    background: var(--white);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 114, 120, 0.08);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.search-help-btn {
    position: absolute;
    right: 40px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-help-btn:hover {
    background: var(--bg-color);
    color: var(--primary);
}

.search-help-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--spacing-xs);
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.search-help-content {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.search-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.search-help-header strong {
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.search-help-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.search-help-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.search-help-content p {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.search-help-content ul {
    margin: 0 0 var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.search-help-content li {
    margin-bottom: 4px;
}

.search-help-content li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.search-help-note {
    margin: var(--spacing-sm) 0 0 0 !important;
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    border-left: 3px solid var(--primary);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.member-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Checkbox Toggle (Show archived) */
.checkbox-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    user-select: none;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.checkbox-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-toggle-label {
    white-space: nowrap;
}

/* Filter Dropdowns */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 7px 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-dropdown-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-light);
}

.filter-dropdown-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-dropdown-btn .chevron {
    transition: transform var(--transition-fast);
}

.filter-dropdown-btn.open .chevron {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown-content {
    padding: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.quick-tag-create {
    padding: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.quick-tag-create input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-family: var(--font-family-body);
}

.quick-tag-create input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-dropdown-footer {
    padding: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: var(--font-size-sm);
    font-family: var(--font-family-body);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

/* Export Menu */
.export-menu-section {
    padding: var(--spacing-xs) 0;
}

.export-menu-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.export-menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-xs) var(--spacing-sm);
    margin-bottom: 4px;
}

.export-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.export-menu-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.export-menu-item svg {
    flex-shrink: 0;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 2px;
    background: var(--bg-color);
    padding: 2px;
    border-radius: var(--radius-md);
}

.view-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.view-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Filter Bar - Legacy (will be removed) */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.filter-controls {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    flex: 1;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.action-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.tag-filters {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tag-filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family-body);
    text-align: left;
    width: 100%;
}

.tag-filter:hover {
    background: var(--bg-color);
}

.tag-filter.active {
    background: var(--bg-color);
    color: var(--primary-color);
}

.tag-filter input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Tag colors */
.tag-filter[data-color="moss"] { --tag-color: #5a7d5a; }
.tag-filter[data-color="stone"] { --tag-color: #6d7278; }
.tag-filter[data-color="earth"] { --tag-color: #7d6a5a; }
.tag-filter[data-color="water"] { --tag-color: #5a7d8d; }
.tag-filter[data-color="forest"] { --tag-color: #3d5a3d; }
.tag-filter[data-color="clay"] { --tag-color: #a0614a; }
.tag-filter[data-color="sage"] { --tag-color: #8a9a7b; }
.tag-filter[data-color="ocean"] { --tag-color: #4a7c8c; }

.tag-filter[data-color]:not(.active) {
    border-color: var(--tag-color);
    color: var(--tag-color);
}

.tag-filter[data-color].active {
    background: var(--tag-color);
    border-color: var(--tag-color);
    color: white;
}

/* Status filters */
.status-filters {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family-body);
    text-align: left;
    width: 100%;
}

.status-filter:hover {
    background: var(--bg-color);
}

.status-filter.active {
    background: var(--bg-color);
    color: var(--primary-color);
}

.status-filter input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.available {
    background: var(--status-available);
}

.status-indicator.maybe {
    background: var(--status-maybe);
}

.status-indicator.offline {
    background: var(--status-offline);
}

/* Sort select */
.sort-select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-primary);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    cursor: pointer;
    transition: all var(--transition-fast);
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.sort-select:hover {
    border-color: var(--primary-light);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 114, 120, 0.1);
}

/* Tag management */
.tag-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.tag-item-info {
    flex: 1;
    min-width: 0;
}

.tag-item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tag-item-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.tag-color-selector {
    display: flex;
    gap: var(--spacing-xs);
}

.tag-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag-color-option:hover {
    transform: scale(1.1);
}

.tag-color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--white);
}

.tag-color-option.moss { background: #5a7d5a; }
.tag-color-option.stone { background: #6d7278; }
.tag-color-option.earth { background: #7d6a5a; }
.tag-color-option.water { background: #5a7d8d; }
.tag-color-option.forest { background: #3d5a3d; }
.tag-color-option.clay { background: #a0614a; }
.tag-color-option.sage { background: #8a9a7b; }
.tag-color-option.ocean { background: #4a7c8c; }

.tag-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* Team List */
.team-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* List View */
.team-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.team-list.list-view .team-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: var(--spacing-md);
    box-shadow: none;
}

.team-list.list-view .team-card:first-child {
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.team-list.list-view .team-card:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.team-list.list-view .team-card:hover {
    transform: none;
    background: var(--bg-color);
}

.team-list.list-view .team-card-header {
    align-items: center;
}

.team-list.list-view .team-card-time {
    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
}

.team-list.list-view .team-card-current-time {
    font-size: var(--font-size-sm);
}

.team-list.list-view .team-card-timezone,
.team-list.list-view .team-card-difference {
    font-size: 0.75rem;
}

/* List View Row Layout */
.team-list.list-view .team-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--spacing-lg);
    align-items: center;
}

.team-list.list-view .team-card-header {
    margin: 0;
}

.team-list.list-view .team-card-tags {
    margin: 0;
}

/* Team Member Card */
.team-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--card-padding);
    box-shadow: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.team-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.team-card.starred {
    border-left: 3px solid var(--primary-color);
}

.team-card.archived {
    opacity: 0.6;
    border-style: dashed;
    background: var(--bg-color);
}

.team-card.archived::after {
    content: "Archived";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--white);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Card Actions */
.team-card-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 1;
}

.card-checkbox {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-checkbox:hover {
    background: var(--bg-color);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.card-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.card-checkbox.checked svg rect {
    fill: currentColor;
}

.card-checkbox.checked:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.card-star.active {
    color: var(--primary-color);
}

.star-indicator {
    color: var(--primary-color);
    margin-right: 4px;
    vertical-align: middle;
}

/* Bulk Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: calc(20px + var(--safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-left: calc(var(--spacing-lg) + var(--safe-area-inset-left));
    padding-right: calc(var(--spacing-lg) + var(--safe-area-inset-right));
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    z-index: 100;
    animation: slideUp 0.2s ease;
}

.bulk-action-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.bulk-action-info span {
    font-weight: 600;
    color: var(--text-primary);
}

.bulk-action-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.team-card-info {
    flex: 1;
}

.team-card-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.team-card-position {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.team-card-affiliation {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.team-card-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: gentlePulse 3s ease-in-out infinite;
}

.team-card-status.available {
    background: var(--status-available);
}

.team-card-status.maybe {
    background: var(--status-maybe);
}

.team-card-status.offline {
    background: var(--status-offline);
}

.team-card-time {
    text-align: center;
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.team-card-datetime {
    margin-bottom: var(--spacing-sm);
}

.team-card-current-time {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--font-family-heading);
}

.team-card-current-date {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 500;
}

.team-card-timezone {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--text-muted);
    transition: all 0.2s ease;
}

.team-card-timezone:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.team-card-difference {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Timezone Tooltip */
.timezone-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--text-primary);
    color: var(--white);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.timezone-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.timezone-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.timezone-tooltip:hover::before {
    opacity: 1;
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .timezone-tooltip::after {
        left: auto;
        right: 0;
        transform: translateX(0);
        max-width: 200px;
        white-space: normal;
        text-align: center;
    }

    .timezone-tooltip::before {
        left: auto;
        right: 20px;
        transform: translateX(0);
    }

    .timezone-tooltip:hover::after {
        transform: translateX(0) translateY(-4px);
    }
}

.team-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.team-card-tag {
    padding: 2px var(--spacing-xs);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Out of Office Indicator */
.team-card-ooo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: #856404;
}

.team-card-ooo svg {
    flex-shrink: 0;
    stroke: #856404;
}

:root[data-dark-mode="true"] .team-card-ooo {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

:root[data-dark-mode="true"] .team-card-ooo svg {
    stroke: #ffc107;
}

/* Team Card Footer */
.team-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.card-action-btn,
.card-star-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-action-btn:hover,
.card-star-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.card-star-btn.active {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}

.card-star-btn.active:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Bottom Actions */
.bottom-actions {
    position: sticky;
    bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
    text-align: center;
    margin-top: var(--spacing-2xl);
    padding-left: var(--safe-area-inset-left);
    padding-right: var(--safe-area-inset-right);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-light);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.icon-btn-primary {
    background: var(--primary-color);
    color: white;
}

.icon-btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

/* Add Guest modal should appear on top of planner modal */
#add-guest-modal {
    z-index: 1100;
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

/* Modal actions inside modal-body */
.modal-body .modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Modal actions outside modal-body (as sibling to modal-body) */
.modal-content > .modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal footer (same styling as actions outside modal-body) */
.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Advanced Filters */
#advanced-filter-modal .filter-section {
    display: block;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

#advanced-filter-modal .filter-section:last-of-type {
    border-bottom: none;
}

#advanced-filter-modal .filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

#advanced-filter-modal input[type="time"] {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
}

#filter-presets-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.filter-preset-item:hover {
    border-color: var(--primary-color);
    background: var(--white);
}

.filter-preset-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.filter-preset-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    color: var(--text-primary);
    background: var(--white);
    transition: all var(--transition-fast);
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 114, 120, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.checkbox-label:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label .star-icon {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked + .star-icon {
    color: var(--primary-color);
}

.checkbox-label span {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

/* Tag input */
.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    min-height: 32px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 4px var(--spacing-sm);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    animation: slideIn 0.2s ease;
}

.tag-chip-remove {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background var(--transition-fast);
}

.tag-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tag-input-wrapper {
    position: relative;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.tag-suggestion-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
}

.tag-suggestion-item:hover {
    background: var(--bg-color);
}

.tag-suggestion-item.create-new {
    color: var(--primary-color);
    font-weight: 500;
    border-top: 1px solid var(--border-color);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-section {
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.form-section summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    padding: var(--spacing-xs);
    user-select: none;
}

.form-section summary:hover {
    color: var(--primary-color);
}

.form-section-content {
    padding-top: var(--spacing-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Settings */
.settings-section {
    margin-bottom: var(--spacing-xl);
}

.settings-section h3 {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* Working Hours Presets */
.presets-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.preset-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

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

.preset-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.preset-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.preset-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-color);
    border-color: var(--primary-light);
    color: var(--text-primary);
}

/* Working hours presets in modal */
.work-hours-presets {
    margin-bottom: var(--spacing-md);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.btn-preset {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-preset:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

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

.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
}

.theme-option:hover {
    border-color: var(--primary-light);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.theme-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.theme-preview.stone {
    background: linear-gradient(135deg, #6d7278 0%, #9a9ea3 100%);
}

.theme-preview.earth {
    background: linear-gradient(135deg, #7d6a5a 0%, #a58f7f 100%);
}

.theme-preview.water {
    background: linear-gradient(135deg, #5a7d8d 0%, #7fa5b5 100%);
}

.theme-preview.forest {
    background: linear-gradient(135deg, #5a7d5a 0%, #7fa57f 100%);
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.about-text.small {
    font-size: var(--font-size-sm);
}

/* Travel Entries */
.travel-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.travel-entry-content {
    flex: 1;
}

/* Notifications */
.notification {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 500px;
    z-index: 2000;
    transform: translateX(calc(100% + var(--spacing-lg)));
    transition: transform var(--transition-normal);
    border-left: 4px solid var(--primary-color);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left-color: #27ae60;
}

.notification-error {
    border-left-color: #e74c3c;
}

.notification-info {
    border-left-color: var(--primary-color);
}

/* Planner */
/* Meeting Planner - Professional Layout */
.modal-xl {
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
}

.planner-modal-body {
    padding: 0;
    max-height: calc(90vh - 80px);
    overflow: hidden;
}

.planner-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100%;
    min-height: 600px;
}

/* Sidebar */
.planner-sidebar {
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
}

.planner-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.planner-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.planner-section-header h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.planner-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.planner-quick-select {
    margin-bottom: var(--spacing-sm);
}

.planner-quick-add {
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-md);
    flex-shrink: 0;
}

.planner-section-header {
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    flex-shrink: 0;
}

.planner-section-header h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Search Box */
.planner-search-wrapper {
    padding: 0 var(--spacing-md) var(--spacing-md);
    flex-shrink: 0;
}

.planner-search-box {
    position: relative;
}

.planner-search-box .search-icon {
    position: absolute;
    right: 12px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.planner-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    font-family: var(--font-family-body);
    background: var(--white);
    transition: all var(--transition-fast);
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.planner-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.planner-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.planner-search-result-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    border-bottom: 1px solid var(--bg-color);
}

.planner-search-result-item:last-child {
    border-bottom: none;
}

.planner-search-result-item:hover {
    background: var(--bg-color);
}

.planner-search-result-info {
    flex: 1;
    min-width: 0;
}

.planner-search-result-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.planner-search-result-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.planner-search-empty {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Filter Row */
.planner-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md) var(--spacing-md);
    flex-shrink: 0;
}

.planner-filter-select {
    padding: 8px var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: var(--font-family-body);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.planner-filter-select:hover {
    border-color: var(--primary-light);
}

.planner-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Selected Participants Section */
.planner-selected-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.planner-selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}

.planner-selected-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.planner-selected-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.planner-empty-state {
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.planner-selected-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px var(--spacing-sm);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    transition: all var(--transition-fast);
}

.planner-selected-chip:hover {
    background: var(--white);
    border-color: var(--primary-light);
}

.planner-selected-chip-name {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planner-selected-chip-remove {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.planner-selected-chip-remove:hover {
    background: var(--error-light);
    color: var(--error-color);
}

.planner-controls {
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    flex-shrink: 0;
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.planner-autocomplete-wrapper {
    position: relative;
}

.planner-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.planner-autocomplete-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
}

.planner-autocomplete-item:hover {
    background: var(--bg-color);
}

.planner-filters {
    margin-bottom: var(--spacing-sm);
}

.planner-filter-group {
    margin-bottom: var(--spacing-sm);
}

.planner-filter-group summary {
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--spacing-xs) 0;
    user-select: none;
    list-style: none;
}

.planner-filter-group summary::-webkit-details-marker {
    display: none;
}

.planner-filter-group summary::before {
    content: '›';
    display: inline-block;
    margin-right: var(--spacing-xs);
    transition: transform var(--transition-fast);
    font-size: 1.2em;
}

.planner-filter-group[open] summary::before {
    transform: rotate(90deg);
}

.planner-tag-filters {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.planner-filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: 4px 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.planner-filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.planner-filter-checkbox:hover {
    color: var(--text-primary);
}

.planner-status-filters {
    padding-left: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.planner-select {
    width: 100%;
    padding: 4px var(--spacing-xs);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: var(--font-family-body);
    background: var(--white);
    cursor: pointer;
}

.planner-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.participant-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.participant-tags .tag-filter {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Old duplicate styles removed */

.planner-participant-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: var(--spacing-sm) 0;
    padding: 0 var(--spacing-md);
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
    align-content: start;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.participant-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.participant-item input[type="checkbox"] {
    cursor: pointer;
}

.participant-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-ooo-badge {
    display: inline-block;
    padding: 1px 4px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #856404;
    flex-shrink: 0;
}

:root[data-dark-mode="true"] .participant-ooo-badge {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* Guest Members */
.planner-add-guest-btn {
    width: calc(100% - var(--spacing-md) * 2);
    margin: var(--spacing-xs) var(--spacing-md) var(--spacing-sm);
    padding: 6px var(--spacing-sm);
    background: var(--white);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.planner-add-guest-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.planner-add-guest-btn svg {
    opacity: 0.7;
}

.participant-guest-badge {
    display: inline-block;
    padding: 1px 4px;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: var(--radius-sm);
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1976d2;
    flex-shrink: 0;
}

:root[data-dark-mode="true"] .participant-guest-badge {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

.participant-item-guest {
    background: rgba(33, 150, 243, 0.03);
    border-left: 3px solid #2196f3;
}

.participant-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0.6;
}

.participant-remove-btn:hover {
    background: var(--error-light);
    color: var(--error-color);
    opacity: 1;
}

/* Main Timeline Area */
.planner-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
}

.planner-timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.timeline-header {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.timeline-scrubber {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.timeline-scrubber-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-md);
}

.timeline-scrubber-label label {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.timeline-time-input-wrapper {
    display: flex;
    align-items: center;
}

.timeline-time-input-wrapper input[type="time"] {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 120px;
}

.timeline-time-input-wrapper input[type="time"]:hover {
    border-color: var(--primary-color);
}

.timeline-time-input-wrapper input[type="time"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-scrubber label {
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-scrubber input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    cursor: pointer;
}

.timeline-scrubber input[type="range"]:hover {
    height: 10px;
}

/* Track styles for different browsers */
.timeline-scrubber input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--slider-progress, 0%), var(--border-color) var(--slider-progress, 0%), var(--border-color) 100%);
    transition: all 0.2s ease;
}

.timeline-scrubber input[type="range"]:hover::-webkit-slider-runnable-track {
    height: 10px;
}

.timeline-scrubber input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    border: none;
}

.timeline-scrubber input[type="range"]::-moz-range-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--primary-color);
}

.timeline-scrubber input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.timeline-scrubber input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.timeline-scrubber input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.timeline-scrubber input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.timeline-scrubber input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.timeline-scrubber input[type="range"]::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.timeline-hour-label {
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.timeline-row {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.timeline-row-user {
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.timeline-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-md) 0;
    position: relative;
}

.timeline-divider::before {
    content: 'Team members';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 0 var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-member-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.timeline-user-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

.timeline-bar {
    display: flex;
    gap: 1px;
    height: 40px;
}

.timeline-bar-segment {
    flex: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 2px;
    opacity: 0.8;
}

.timeline-bar-segment.available {
    background: rgba(39, 174, 96, 0.4);
}

.timeline-bar-segment.maybe {
    background: rgba(243, 156, 18, 0.4);
}

.timeline-bar-segment.offline {
    background: rgba(149, 165, 166, 0.25);
}

.timeline-bar-segment.selected {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    transform: scaleY(1.15);
    opacity: 1;
    z-index: 1;
}

.timeline-bar-segment:hover {
    transform: scaleY(1.3);
    opacity: 1;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-bar-segment:active {
    transform: scaleY(1.1);
}

.timeline-member-time {
    text-align: right;
    font-size: var(--font-size-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.timeline-status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-member-time.available .timeline-status-label {
    color: var(--status-available);
}

.timeline-member-time.maybe .timeline-status-label {
    color: var(--status-maybe);
}

.timeline-member-time.offline .timeline-status-label {
    color: var(--status-offline);
}

.timeline-suggestions {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
}

.timeline-suggestion {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.timeline-suggestion.success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.timeline-suggestion.warning {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.timeline-suggestion strong {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.suggestion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.timeline-suggestion.success .suggestion-icon {
    color: var(--status-available);
}

.timeline-suggestion.warning .suggestion-icon {
    color: var(--status-maybe);
}

.timeline-suggestion ul {
    margin-left: var(--spacing-lg);
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
}

.suggestion-hours {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.suggestion-hour {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.suggestion-hour:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Quick Comparison View */
.comparison-timelines {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.comparison-current-time {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.comparison-current-time svg {
    color: var(--primary);
}

.comparison-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.comparison-member {
    padding: var(--spacing-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.comparison-member:hover {
    box-shadow: var(--shadow-sm);
}

.comparison-member-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.comparison-member-info {
    flex: 1;
}

.comparison-member-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.comparison-member-timezone {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comparison-member-ooo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 6px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    color: #856404;
}

.comparison-member-ooo svg {
    stroke: #856404;
}

:root[data-dark-mode="true"] .comparison-member-ooo {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

:root[data-dark-mode="true"] .comparison-member-ooo svg {
    stroke: #ffc107;
}

.comparison-member-current {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.comparison-member-time {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-status-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-member-current.available .comparison-status-badge {
    background: var(--status-available-bg);
    color: var(--status-available-text);
}

.comparison-member-current.maybe .comparison-status-badge {
    background: var(--status-maybe-bg);
    color: var(--status-maybe-text);
}

.comparison-member-current.offline .comparison-status-badge {
    background: var(--status-offline-bg);
    color: var(--status-offline-text);
}

.comparison-timeline-bar {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    margin-bottom: var(--spacing-xs);
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.comparison-bar-segment {
    position: relative;
    background: var(--bg-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.comparison-bar-segment.available {
    background: var(--status-available-bg);
}

.comparison-bar-segment.maybe {
    background: var(--status-maybe-bg);
}

.comparison-bar-segment.offline {
    background: var(--status-offline-bg);
}

.comparison-bar-segment.current {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.comparison-current-marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--primary);
    pointer-events: none;
}

.comparison-bar-segment:hover {
    filter: brightness(0.95);
    transform: scaleY(1.05);
}

.comparison-timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Command Palette */
.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.command-palette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.15s ease;
}

.command-palette-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUp 0.2s ease;
}

.command-palette-search {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.command-palette-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.command-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--font-size-base); /* 16px prevents iOS zoom */
    font-family: var(--font-family-body);
    background: transparent;
    color: var(--text-primary);
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.command-palette-input::placeholder {
    color: var(--text-muted);
}

.command-palette-hint {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-family-body);
}

.command-palette-results {
    max-height: 400px;
    overflow-y: auto;
}

.command-palette-section {
    padding: var(--spacing-sm) var(--spacing-md);
}

.command-palette-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.command-palette-item:hover,
.command-palette-item.selected {
    background: var(--bg-color);
}

.command-palette-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.command-palette-item-content {
    flex: 1;
    min-width: 0;
}

.command-palette-item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.command-palette-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.command-palette-item-shortcut {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Keyboard Shortcuts */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.shortcut-item kbd {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: var(--font-family-body);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-weight: 600;
}

.shortcut-item span {
    flex: 1;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gentlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .app-title {
        font-size: var(--font-size-lg);
    }

    .app-tagline {
        font-size: 0.75rem;
    }

    .app-logo {
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    /* Modal close button - larger touch target on mobile */
    .modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
    }

    /* Modal header - safe area padding for iPhone notch/browser bar */
    .modal-header {
        padding-top: calc(var(--spacing-lg) + var(--safe-area-inset-top));
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        width: 100%;
    }

    .action-controls {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
        min-width: 0; /* Allow select to shrink properly */
    }

    /* Toolbar - comprehensive mobile responsive layout */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }

    .toolbar-left {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        order: 2; /* Put filters below actions on mobile */
    }

    .toolbar-right {
        width: 100%;
        justify-content: space-between;
        order: 1; /* Put primary actions at top */
    }

    /* Filter dropdowns - full width on mobile */
    .filter-dropdown {
        width: 100%;
    }

    .filter-dropdown-btn {
        width: 100%;
        justify-content: space-between;
    }

    /* Advanced filter button - full width */
    #advanced-filter-btn {
        width: 100%;
        justify-content: center;
    }

    /* Sort select - full width */
    .sort-select {
        width: 100%;
        flex: none;
    }

    /* Member count - centered */
    .member-count {
        text-align: center;
        display: block;
        padding: var(--spacing-xs) 0;
    }

    /* Show archived toggle - full width with better spacing */
    .checkbox-toggle {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-sm);
        background: var(--bg-color);
        border-radius: var(--radius-md);
    }

    /* View switcher - keep together */
    .view-switcher {
        flex-shrink: 0;
    }

    /* Add member button - flexible */
    #add-member-btn {
        flex: 1;
        min-width: max-content;
    }

    .team-list {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .theme-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        padding: var(--spacing-md);
    }

    .modal-content {
        max-height: 95vh;
    }

    .tag-item {
        flex-wrap: wrap;
    }

    .tag-color-selector {
        order: 3;
        width: 100%;
        margin-top: var(--spacing-sm);
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .timeline-member-time {
        align-items: flex-start;
    }

    /* Touch-friendly buttons */
    .btn,
    .icon-btn,
    .card-action-btn,
    .tag-filter {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-sm {
        min-height: 40px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Card footer buttons - larger touch targets */
    .team-card-footer {
        gap: var(--spacing-xs);
    }

    .card-action-btn,
    .card-star-btn {
        width: 44px;
        height: 44px;
        padding: var(--spacing-sm);
    }

    /* Bulk action bar - stack on mobile */
    .bulk-action-bar {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }

    .bulk-action-info {
        width: 100%;
        justify-content: space-between;
    }

    .bulk-action-buttons {
        width: 100%;
        justify-content: stretch;
        gap: var(--spacing-sm);
    }

    .bulk-action-buttons .btn {
        flex: 1;
        justify-content: center;
    }

    /* Search bar - full width on mobile */
    .search-container {
        width: 100%;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Form inputs - prevent zoom on iOS */
    input[type="text"],
    input[type="email"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px;
    }

    /* Header actions - better spacing */
    .header-actions {
        gap: var(--spacing-xs);
    }

    /* Command palette - full screen on mobile */
    .command-palette {
        width: 100%;
        max-height: 90vh;
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding-left: var(--safe-area-inset-left);
        padding-right: var(--safe-area-inset-right);
        padding-bottom: var(--safe-area-inset-bottom);
    }

    /* Modal - better mobile experience */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
        padding-left: calc(var(--spacing-lg) + var(--safe-area-inset-left));
        padding-right: calc(var(--spacing-lg) + var(--safe-area-inset-right));
        padding-bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: 10;
        border-bottom: 1px solid var(--border-color);
        margin-left: calc(-1 * var(--safe-area-inset-left));
        margin-right: calc(-1 * var(--safe-area-inset-right));
        padding-top: calc(var(--spacing-lg) + var(--safe-area-inset-top));
        padding-left: calc(var(--spacing-lg) + var(--safe-area-inset-left));
        padding-right: calc(var(--spacing-lg) + var(--safe-area-inset-right));
    }

    /* Dropdown menus - full width on mobile */
    .dropdown-menu {
        width: 100%;
        max-width: 100%;
    }

    /* Tag management - better mobile layout */
    .tag-item-actions {
        flex-wrap: nowrap;
        gap: var(--spacing-xs);
    }

    /* Meeting planner - adjust for mobile */
    .participant-grid {
        grid-template-columns: 1fr;
    }

    .timeline-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Settings grid - single column on mobile */
    .settings-section {
        grid-template-columns: 1fr;
    }

    /* Availability indicator - slightly larger */
    .availability-status {
        width: 12px;
        height: 12px;
    }

    /* Card actions - always visible on mobile (no hover) */
    .team-card:active .team-card-actions {
        opacity: 1;
    }

    .team-card-actions {
        opacity: 0.7;
    }

    /* Bottom action button - larger on mobile */
    .fab {
        width: 56px;
        height: 56px;
    }

    /* Meeting Planner - Mobile Layout */
    .modal-xl {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-xl .modal-body {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .planner-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: auto;
        height: auto;
    }

    .planner-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 40vh;
        overflow-y: auto;
    }

    .planner-section {
        padding: var(--spacing-md);
    }

    .planner-participant-list {
        max-height: 200px;
        grid-template-columns: 1fr;
    }

    .planner-selected-list {
        min-height: 150px;
        max-height: none;
        overflow-y: visible;
        flex: none;
    }

    .planner-selected-section {
        flex: none;
        min-height: auto;
        overflow: visible;
    }

    /* Ensure chips are visible */
    .planner-selected-chip {
        flex-shrink: 0;
    }

    /* Timeline container - ensure it can show all rows */
    .planner-main {
        overflow: visible;
        min-height: 0;
    }

    .planner-timeline-container {
        overflow-y: auto;
        min-height: 300px;
        -webkit-overflow-scrolling: touch;
    }

    .timeline-body {
        overflow: visible;
    }

    .timeline-row {
        grid-template-columns: 100px 1fr 100px;
        gap: var(--spacing-sm);
        font-size: 0.875rem;
        flex-shrink: 0;
    }

    .timeline-bar {
        height: 32px;
    }
}

/* Small Phone Breakpoint (very compact screens) */
@media (max-width: 400px) {
    /* Even more compact spacing */
    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    /* Toolbar - ultra compact */
    .toolbar {
        gap: var(--spacing-sm);
    }

    .toolbar-left,
    .toolbar-right {
        gap: var(--spacing-xs);
    }

    /* Smaller buttons on tiny screens */
    .btn-sm {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Compact filter buttons */
    .filter-dropdown-btn {
        font-size: 0.875rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* More compact search bar */
    .search-bar {
        margin-bottom: var(--spacing-sm);
    }

    /* View switcher buttons smaller */
    .view-btn {
        min-width: 40px;
        padding: var(--spacing-xs);
    }

    /* Reduce header size */
    .app-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .app-title {
        font-size: 1rem;
    }

    .app-tagline {
        display: none; /* Hide tagline on very small screens */
    }

    .app-logo {
        width: 32px;
        height: 32px;
    }

    /* Icon buttons more compact */
    .icon-btn {
        padding: var(--spacing-xs);
        min-width: 36px;
        min-height: 36px;
    }

    /* Member cards more compact */
    .team-card {
        padding: var(--spacing-sm);
    }

    /* Modals take full screen on very small devices */
    .modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* Tablet Breakpoint (iPad, medium tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Layout - 2 column grid for team cards */
    .team-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* Main content - comfortable padding */
    .main-content {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    /* Header - slightly reduced */
    .app-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* Toolbar - better spacing for medium screens */
    .toolbar {
        flex-wrap: wrap;
        gap: var(--spacing-md);
        align-items: center;
    }

    .toolbar-left {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        flex: 1;
        min-width: 0;
    }

    .toolbar-right {
        flex-shrink: 0;
        gap: var(--spacing-sm);
    }

    /* Filter dropdowns - comfortable sizing */
    .filter-dropdown {
        min-width: 140px;
    }

    /* Sort select - flexible width */
    .sort-select {
        min-width: 200px;
        max-width: 280px;
        flex: 1;
    }

    /* Member count - with some padding */
    .member-count {
        padding: 0 var(--spacing-sm);
    }

    /* Checkbox toggle - compact */
    .checkbox-toggle {
        white-space: nowrap;
    }

    /* Search bar - moderate width */
    .search-bar {
        max-width: 600px;
        margin: 0 auto var(--spacing-md);
    }

    /* Modals - better sizing for tablets */
    .modal-content {
        max-width: 90%;
        width: 700px;
    }

    .modal-xl {
        max-width: 95%;
        width: 900px;
    }

    /* Meeting planner - optimize for tablet */
    .planner-layout {
        grid-template-columns: 320px 1fr;
    }

    .planner-sidebar {
        max-height: none;
    }

    /* Forms - 2 column layout */
    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    /* Theme selector - 4 across on tablet */
    .theme-selector {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Touch-friendly buttons maintained */
    .btn,
    .icon-btn {
        min-height: 44px;
    }

    /* Shortcuts grid - 2 columns */
    .shortcuts-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Timeline - comfortable sizing */
    .timeline-row {
        grid-template-columns: 150px 1fr 120px;
        gap: var(--spacing-md);
    }

    /* Comparison view - 2 columns */
    .comparison-timelines {
        gap: var(--spacing-lg);
    }

    /* Settings sections - comfortable layout */
    .settings-section {
        padding: var(--spacing-lg);
    }

    /* Welcome screen - optimized spacing */
    .welcome-content {
        max-width: 600px;
        padding: var(--spacing-2xl);
    }

    /* Card view - ensure cards fill space nicely */
    .team-card {
        min-width: 0; /* Allow cards to shrink properly */
    }

    /* Command palette - moderate width */
    .command-palette-content {
        max-width: 600px;
    }

    /* Filter dropdowns - don't go full width */
    .filter-dropdown-menu {
        min-width: 280px;
        max-width: 400px;
    }

    /* Bulk action bar - keep horizontal on tablet */
    .bulk-action-bar {
        flex-direction: row;
        gap: var(--spacing-md);
    }

    .bulk-action-buttons {
        gap: var(--spacing-sm);
    }

    /* Planner participant grid - 2 columns */
    .planner-participant-list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Selected participants - comfortable height */
    .planner-selected-list {
        max-height: 300px;
        min-height: 100px;
        overflow-y: auto !important;
    }

    .planner-selected-section {
        flex: none;
        min-height: auto;
    }
}

/* App Footer */
.app-footer {
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
    padding-left: calc(var(--spacing-md) + var(--safe-area-inset-left));
    padding-right: calc(var(--spacing-md) + var(--safe-area-inset-right));
    margin: var(--spacing-lg) 0 0 0;
    text-align: center;
}

.app-footer p {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
    margin: 0;
    opacity: 0.6;
}

.footer-link {
    margin-top: 0.25rem !important;
}

/* Help & FAQ */
.help-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.help-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-2xl) 0 var(--spacing-md) 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.help-subtitle:first-child {
    margin-top: 0;
}

.faq-intro {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-style: italic;
    margin-bottom: var(--spacing-lg);
}

.shortcuts-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-2xl);
}

.shortcuts-grid-compact .shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.shortcuts-grid-compact kbd {
    display: inline-block;
    min-width: 32px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-family-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    background: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 0 var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

.shortcuts-grid-compact .shortcut-item span {
    color: var(--text-secondary);
    flex: 1;
}

/* FAQ Accordion */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.faq-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.faq-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-header:hover {
    background: var(--bg-color);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    font-weight: 300;
}

.faq-item.open .faq-icon {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    padding: 0 var(--spacing-lg);
}

.faq-item.open .faq-content {
    max-height: 2000px;
    padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
}

.faq-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.faq-content p:last-child {
    margin-bottom: 0;
}

.faq-content ul,
.faq-content ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xl);
    color: var(--text-secondary);
}

.faq-content li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.faq-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.faq-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.faq-content a:hover {
    border-bottom-color: var(--primary-color);
}

.faq-content kbd {
    display: inline-block;
    min-width: 28px;
    padding: 0.2rem 0.45rem;
    font-family: var(--font-family-body);
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 0 var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Device Support */
/* Devices without hover capability (touch screens) */
@media (hover: none) and (pointer: coarse) {
    /* Make card actions always visible on touch devices */
    .team-card-actions {
        opacity: 1;
    }

    /* Remove hover-only tooltips, rely on tap */
    .team-card:hover .team-card-actions {
        opacity: 1; /* Already visible */
    }

    /* Better touch feedback for interactive elements */
    .btn:active,
    .icon-btn:active,
    .card-action-btn:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    /* Dropdown buttons - visual feedback on tap */
    .filter-dropdown-btn:active {
        background: var(--bg-color);
    }

    /* Timeline segments - always show interaction affordance */
    .timeline-bar-segment {
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .timeline-bar-segment:active {
        opacity: 0.8;
    }

    /* Search results - tap feedback */
    .planner-search-result-item:active,
    .tag-suggestion-item:active,
    .command-palette-item:active {
        background: var(--primary-light);
        color: var(--white);
    }

    /* Card checkbox - larger tap target */
    .card-checkbox {
        min-width: 44px;
        min-height: 44px;
    }

    /* Make star button more prominent on touch */
    .card-star-btn {
        opacity: 0.8;
    }

    .card-star-btn.active {
        opacity: 1;
    }

    /* Remove hover cursor changes, use default */
    * {
        cursor: default !important;
    }

    button, a, input[type="button"], input[type="submit"], .btn, .icon-btn {
        cursor: pointer !important;
    }

    /* FAQ items - tap to expand (no hover preview) */
    .faq-item {
        border-color: var(--border-color);
    }

    /* Participant items - always show remove button */
    .participant-remove-btn {
        opacity: 1;
    }

    /* Planner selected chips - always show remove */
    .planner-selected-chip-remove {
        opacity: 1;
    }

    /* Filter preset items - always show actions */
    .filter-preset-item {
        opacity: 1;
    }

    /* Tag chip remove - always visible */
    .tag-chip-remove {
        opacity: 1;
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    
    /* Prevent text size adjustment on iOS */
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Better touch handling for interactive elements */
    button,
    .btn,
    .icon-btn,
    .card-action-btn,
    .card-star-btn,
    .card-checkbox,
    a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(109, 114, 120, 0.2);
    }
    
    /* Smooth scrolling on iOS */
    .team-list,
    .modal-body,
    .planner-timeline-container,
    .comparison-timelines {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* Fix input appearance on iOS */
    input[type="text"],
    input[type="email"],
    input[type="time"],
    input[type="search"],
    select,
    textarea {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--radius-md);
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Fix select dropdown appearance */
    select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right var(--spacing-sm) center;
        background-size: 12px;
        padding-right: calc(var(--spacing-lg) + 12px);
    }
    
    /* Fix date/time input appearance */
    input[type="time"] {
        padding: var(--spacing-sm);
    }
    
    /* Better modal behavior on iOS */
    .modal-content {
        -webkit-overflow-scrolling: touch;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Fix button active states on iOS */
    button:active,
    .btn:active,
    .icon-btn:active {
        opacity: 0.7;
    }
    
    /* Prevent pull-to-refresh on modals */
    .modal-overlay {
        overscroll-behavior: contain;
    }
    
    /* Better focus styles for iOS */
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Add :active states for all interactive elements (works on both touch and mouse) */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
    transform: translateY(1px);
}

.icon-btn:active {
    background: var(--bg-color);
}

.card-action-btn:active {
    background: var(--bg-color);
}

.view-btn:active {
    background: var(--primary-color);
    color: var(--white);
}

.filter-dropdown-btn:active {
    background: var(--bg-color);
}

.tag-filter:active,
.status-filter:active {
    transform: translateY(1px);
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.icon-btn:focus-visible,
.card-action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 0;
    border-color: var(--primary-color);
}

.team-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
}

.toast {
    background: var(--white);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-icon {
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #27ae60;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.warning .toast-icon {
    color: #f39c12;
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile toast positioning */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
        right: var(--spacing-md);
        left: var(--spacing-md);
        max-width: none;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* Enhanced Card Hover States */
.team-card {
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-light);
}

.team-card:active {
    transform: translateY(0);
}

/* Form Validation Feedback */
.form-group {
    position: relative;
}

input.error,
select.error,
textarea.error {
    border-color: #e74c3c !important;
    background-color: #fff5f5;
}

input.success,
select.success,
textarea.success {
    border-color: #27ae60 !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-message svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

input:focus.error,
select:focus.error,
textarea:focus.error {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

input:focus.success,
select:focus.success,
textarea:focus.success {
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Success checkmark icon */
.success-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    pointer-events: none;
}

/* Confirmation Modal Styling */
#confirm-modal .modal-body {
    padding: var(--spacing-xl) var(--spacing-lg);
}

#confirm-modal #confirm-message {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

#confirm-modal .modal-footer {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Better Empty States */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.3;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-message {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.empty-state-action {
    margin-top: var(--spacing-md);
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* First Member CTA Card */
.first-member-cta-card {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--spacing-2xl);
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-color) 100%);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.first-member-cta-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.first-member-cta-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(91, 114, 88, 0.2);
}

.first-member-cta-icon svg {
    color: var(--white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.first-member-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
    font-family: var(--font-display);
}

.first-member-cta-message {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--spacing-xl) 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta-large {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(91, 114, 88, 0.3);
    font-family: var(--font-body);
}

.btn-cta-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 114, 88, 0.4);
}

.btn-cta-large:active {
    transform: translateY(0);
}

.first-member-cta-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cta-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    text-align: left;
}

.cta-feature svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.cta-feature span {
    font-weight: 500;
}

.first-member-cta-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: var(--spacing-md) 0 0 0;
}

.first-member-cta-hint a {
    font-weight: 500;
    transition: color 0.2s ease;
}

.first-member-cta-hint a:hover {
    color: var(--primary-dark);
}

/* Responsive adjustments for CTA card */
@media (max-width: 768px) {
    .first-member-cta-card {
        padding: var(--spacing-xl);
        margin: var(--spacing-md);
    }

    .first-member-cta-icon {
        width: 100px;
        height: 100px;
    }

    .first-member-cta-icon svg {
        width: 64px;
        height: 64px;
    }

    .first-member-cta-title {
        font-size: 1.5rem;
    }

    .btn-cta-large {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
    }
}

/* Print Styles */
@media print {
    .app-header,
    .bottom-actions,
    .modal {
        display: none;
    }

    .team-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
