/* ============================================
   COMPONENTS CSS - Reusable UI Components
   ============================================ */
@import url('./utilities.css');

/* CARD COMPONENT */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-slow);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 2px solid var(--color-border-light);
    padding-bottom: var(--spacing-base);
    margin-bottom: var(--spacing-base);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: var(--spacing-xs) 0 0 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--spacing-base);
    margin-top: var(--spacing-base);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* STATUS BADGE */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
}

.status-badge.pending {
    background: var(--color-warning-bg);
    color: #856404;
}

.status-badge.active {
    background: var(--color-success-bg);
    color: #155724;
}

.status-badge.completed {
    background: var(--color-info-bg);
    color: #084298;
}

.status-badge.rejected {
    background: var(--color-error-bg);
    color: #721c24;
}

.status-badge.accepted {
    background: var(--color-info-bg);
    color: #0c5460;
}

.status-badge.counter-offered {
    background: var(--color-background-dark);
    color: #383d41;
}

/* RATING COMPONENT */
.rating {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.rating-star {
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-border);
    transition: color var(--transition-base);
}

.rating-star.filled {
    color: var(--color-warning);
}

.rating-star:hover,
.rating-star.hover {
    color: var(--color-warning);
}

.rating-value {
    margin-left: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

/* INFO BOX */
.info-box {
    background: var(--color-background);
    border-left: 4px solid var(--color-primary);
    padding: var(--spacing-base);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
}

.info-box.warning {
    border-left-color: var(--color-warning);
    background: #fffbf0;
}

.info-box.danger {
    border-left-color: var(--color-error);
    background: var(--color-error-bg);
}

.info-box.success {
    border-left-color: var(--color-success);
    background: var(--color-success-bg);
}

.info-box-title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.info-box-text {
    font-size: var(--font-size-sm);
    color: #555;
    margin: 0;
}

/* PROGRESS BAR */
.progress-bar {
    background: var(--color-background-dark);
    height: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: var(--spacing-sm) 0;
}

/* GLOBAL SPINNER */
.global-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.25);
    z-index: var(--z-modal-backdrop, 9000);
    align-items: center;
    justify-content: center;
}

.global-spinner .spinner {
    width: 48px;
    height: 48px;
    border: 6px solid rgba(255,255,255,0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Show spinner when body has .is-loading */
body.is-loading .global-spinner {
    display: flex;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    touch-action: manipulation;
}

@media (max-width: 767px) {
    .btn {
        padding: 12px 18px;
        font-size: 1rem;
        min-height: 48px;
    }
    .modal-content { width: 100%; height: 100%; border-radius: 0; max-height: 100vh; }
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    transition: width var(--transition-slow);
    border-radius: var(--radius-sm);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, var(--color-error) 0%, var(--color-error-dark) 100%);
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
}

.progress-bar-fill.success {
    background: linear-gradient(90deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

/* LIST ITEMS */
.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-base);
    padding: var(--spacing-base) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-icon {
    font-size: var(--font-size-xl);
    min-width: 30px;
    text-align: center;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.list-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: var(--spacing-xs) 0 0 0;
}

.list-item-action {
    display: flex;
    gap: var(--spacing-sm);
}

/* MODAL OVERLAY */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay);
    z-index: var(--z-modal-backdrop);
    animation: fadeIn var(--transition-slow);
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-slow);
}

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

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color var(--transition-slow);
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

/* TABS */
.tabs-container {
    margin-bottom: var(--spacing-lg);
}

.tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border-light);
    overflow-x: auto;
}

.tab-button {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-slow);
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--color-primary);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-slow);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: var(--spacing-4xl) var(--spacing-lg);
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
}

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

.empty-state-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-lg);
}

/* DIVIDER */
.divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--spacing-lg) 0;
}

.divider-text {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    position: relative;
    margin: var(--spacing-lg) 0;
}

.divider-text span {
    background: var(--color-surface);
    padding: 0 var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.divider-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border-light);
    z-index: 0;
}

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

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

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

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

/* TOOLTIP */
.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--color-primary);
}

.tooltip-text {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-secondary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-md);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: var(--color-secondary);
}

.tooltip:hover .tooltip-text {
    display: block;
}

/* LOADING SKELETON */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}

/* Skeleton Card - for job/driver cards */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.skeleton-card .skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.skeleton-card .skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card .skeleton-badge {
    width: 80px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-card .skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-card .skeleton-line.short {
    width: 40%;
}

.skeleton-card .skeleton-line.medium {
    width: 70%;
}

.skeleton-card .skeleton-line.long {
    width: 90%;
}

.skeleton-card .skeleton-meta {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.skeleton-card .skeleton-meta-item {
    width: 100px;
    height: 14px;
    border-radius: 4px;
}

.skeleton-card .skeleton-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.skeleton-card .skeleton-btn {
    height: 40px;
    border-radius: 8px;
    flex: 1;
}

/* Skeleton Grid */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Reduced motion: disable skeleton animation for users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: #e8e8e8;
    }
}

/* ============================================
   KEYBOARD SHORTCUTS HELP OVERLAY
   ============================================ */
.keyboard-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.keyboard-shortcuts-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.keyboard-shortcuts-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: shortcuts-appear 0.2s ease-out;
}

@keyframes shortcuts-appear {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.keyboard-shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.keyboard-shortcuts-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.keyboard-shortcuts-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.keyboard-shortcuts-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.keyboard-shortcuts-body {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.shortcut-category h3 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-list {
    margin: 0;
    padding: 0;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item dt {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-item dd {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.shortcut-item kbd {
    display: inline-block;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 0.85rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcut-item .then {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

.keyboard-shortcuts-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    text-align: center;
}

.keyboard-shortcuts-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.keyboard-shortcuts-footer kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.8rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 600px) {
    .keyboard-shortcuts-body {
        grid-template-columns: 1fr;
    }

    .keyboard-shortcuts-content {
        max-height: 90vh;
        margin: 16px;
    }
}

/* ============================================
   JOB APPLICATION STYLES
   ============================================ */

/* Application Card */
.application-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.application-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Status styles */
.application-card.status-pending {
    border-left: 4px solid #ff9800;
}

.application-card.status-accepted {
    border-left: 4px solid #4caf50;
    background-color: #f1f8f4;
}

.application-card.status-rejected {
    border-left: 4px solid #f44336;
    opacity: 0.85;
}

.application-card.status-withdrawn {
    border-left: 4px solid #9e9e9e;
    opacity: 0.75;
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.application-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-pending {
    background-color: #fff3e0;
    color: #e65100;
}

.status-badge.status-accepted {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-rejected {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge.status-withdrawn {
    background-color: #f5f5f5;
    color: #616161;
}

.application-body {
    margin-bottom: 16px;
}

.application-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.application-meta p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.application-meta strong {
    color: var(--color-text-primary);
}

.application-message,
.application-response,
.driver-info {
    margin: 16px 0;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
}

.application-message strong,
.application-response strong,
.driver-info strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.application-message p,
.application-response p,
.driver-info p {
    margin: 4px 0;
    color: #555;
    font-size: 0.95rem;
}

.application-contract {
    padding: 12px;
    background-color: #e8f5e9;
    border-radius: 6px;
    border-left: 3px solid #4caf50;
    margin: 12px 0;
}

.success-text {
    color: #2e7d32;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.application-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.application-actions .btn {
    flex: 0 1 auto;
}

/* Grid layout for applications */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.applications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.job-applications-group {
    margin-bottom: 32px;
}

.job-applications-group h2 {
    font-size: 1.3rem;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

/* Apply job form */
.apply-job-form {
    padding: 20px;
}

.apply-job-form .form-group {
    margin-bottom: 20px;
}

.form-info {
    padding: 12px;
    background-color: #f1f8f4;
    border-radius: 6px;
    border-left: 3px solid #4caf50;
    margin-top: 16px;
}

.form-info p {
    margin: 0;
    color: #2e7d32;
    font-size: 0.95rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Driver bio in details */
.driver-bio {
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 6px;
    margin: 16px 0;
}

.driver-bio strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.driver-bio p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* Responsive for mobile */
@media (max-width: 767px) {
    .application-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-badge {
        margin-top: 8px;
    }

    .application-meta {
        grid-template-columns: 1fr;
    }

    .applications-grid {
        grid-template-columns: 1fr;
    }

    .application-actions {
        flex-direction: column;
    }

    .application-actions .btn {
        width: 100%;
    }
}


/* ============================================
   MESSAGING UI STYLES
   ============================================ */

.messaging-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px); /* Fixed height for proper scrolling */
    min-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.messaging-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messaging-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-text-primary);
}

/* Main messaging layout */
.messaging-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Conversations Panel */
.conversations-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    background: #f5f5f5;
    overflow: hidden;
}

.conversations-header {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.conversation-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: background 0.2s;
    background: white;
}

.conversation-item:hover {
    background: #fafafa;
}

.conversation-item.active {
    background: #e3f2fd;
    border-right: 3px solid #2196f3;
}

.conversation-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1.2rem;
}

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

.avatar-placeholder {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-info {
    flex: 1;
    min-width: 0;
    position: relative;
}

.conversation-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conversation-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.8rem;
    color: #999;
    margin-left: 8px;
    flex-shrink: 0;
}

.conversation-preview {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff5252;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Chat Window */
.chat-window {
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

.chat-user-info h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.user-status {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #4caf50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
}

.close-btn:hover {
    color: var(--color-text-primary);
}

/* Messages List */
.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f5f5;
}

.message {
    display: flex;
    margin-bottom: 8px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message.sent .message-content {
    background: #2196f3;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-text {
    margin: 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.message.sent .message-time {
    text-align: right;
}

.message-status {
    font-size: 0.8rem;
    margin-left: 4px;
}

.messages-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Message Input Area */
.message-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 100px;
}

.message-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.send-btn {
    background: #2196f3;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #1976d2;
}

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

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #999;
    margin-left: 12px;
}

/* Empty state */
.chat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.chat-empty p {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1023px) {
    .messaging-layout {
        grid-template-columns: 250px 1fr;
    }

    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 767px) {
    .messaging-layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    .conversations-panel {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-right: none;
        z-index: 10;
        transition: transform 0.3s;
        transform: translateX(0);
    }

    .conversations-panel.hidden {
        transform: translateX(-100%);
    }

    .chat-window {
        width: 100%;
    }

    .message-content {
        max-width: 85%;
    }

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


/* ============================================
   DRIVER DASHBOARD ENHANCED STYLES
   ============================================ */

.driver-dashboard {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px 0;
}

.dashboard-header {
    margin-bottom: 40px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--color-text-primary);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin: 0;
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 4px;
}

/* Dashboard Sections */
.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

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

.section-header h2 {
    margin: 0;
    flex: 1;
}

/* Job Cards Compact */
.job-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.job-card-compact {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.job-card-compact:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.job-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.job-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-primary);
    flex: 1;
}

.urgent-badge {
    background: #ffebee;
    color: #c62828;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.job-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item .label {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 600;
}

.detail-item span:last-child {
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.job-actions {
    display: flex;
    gap: 8px;
}

.job-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Applications List */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.application-summary {
    border-left: 4px solid #ff9800;
    padding: 12px;
    background: #fff3e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.application-summary.status-accepted {
    border-left-color: #4caf50;
    background: #f1f8f4;
}

.application-summary.status-rejected {
    border-left-color: #f44336;
    background: #ffebee;
    opacity: 0.8;
}

.application-summary.status-withdrawn {
    border-left-color: #9e9e9e;
    background: #f5f5f5;
}

.application-summary:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.app-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.status-pill {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill.pending {
    background: #fff9c4;
    color: #f57f17;
}

.status-pill.accepted {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-pill.rejected {
    background: #ffcdd2;
    color: #c62828;
}

.status-pill.withdrawn {
    background: #e0e0e0;
    color: #616161;
}

.app-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.app-meta small {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.application-summary .btn {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 6px 10px;
    width: 100%;
}

/* Sidebar Sections */
.dashboard-sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-sidebar-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Quick Action Buttons */
.quick-action-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.quick-action-button:hover {
    background: #f5f7fa;
    border-color: #2196f3;
    transform: translateX(4px);
}

.quick-action-button .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quick-action-button .text {
    font-size: 0.9rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Earnings Card */
.earnings-card {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.earning-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.earning-item:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.earning-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.earning-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* Empty State */
.dashboard-section .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.empty-state p {
    margin: 0 0 16px 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1023px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .job-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .dashboard-header h1 {
        font-size: 1.8rem;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin: 0 auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header .btn {
        width: 100%;
    }

    .job-actions {
        flex-direction: column;
    }

    .job-actions .btn {
        width: 100%;
    }
}


/* ============================================
   SUPPLIER DASHBOARD ENHANCED STYLES
   ============================================ */

.supplier-dashboard {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px 0;
}

/* Jobs Table */
.jobs-table {
    overflow-x: auto;
    margin-bottom: 16px;
}

.jobs-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.jobs-table thead {
    background: #f5f7fa;
    border-bottom: 2px solid #e0e0e0;
}

.jobs-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.9rem;
}

.jobs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 0.95rem;
}

.jobs-table tbody tr:hover {
    background: #f9f9f9;
}

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

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.open {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.assigned {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.in_progress {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.completed {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-badge.cancelled {
    background: #ffcdd2;
    color: #c62828;
}

.jobs-table .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Applications Queue */
.applications-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.application-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: white;
    transition: all 0.2s ease;
}

.application-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.app-driver-info {
    display: flex;
    gap: 8px;
    flex: 1;
    align-items: center;
}

.driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.driver-details h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.driver-details p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.app-job-info {
    flex: 1;
    min-width: 150px;
}

.app-job-info small {
    display: block;
    color: #7f8c8d;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.app-job-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

.app-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.app-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.stats-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.stats-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Responsive for Applications Queue */
@media (max-width: 1023px) {
    .application-item {
        flex-wrap: wrap;
    }

    .app-job-info {
        width: 100%;
        min-width: auto;
    }

    .app-actions {
        width: 100%;
    }

    .app-actions .btn {
        flex: 1;
    }
}

@media (max-width: 767px) {
    .jobs-table {
        font-size: 0.85rem;
    }

    .jobs-table th,
    .jobs-table td {
        padding: 8px 10px;
    }

    .application-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-driver-info {
        width: 100%;
    }

    .app-job-info {
        width: 100%;
    }

    .app-actions {
        width: 100%;
    }

    .app-actions .btn {
        flex: 1;
    }
}


/* ============================================
   NOTIFICATION CENTER STYLES
   ============================================ */

.notification-center {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px 0;
}

.notification-center-header {
    margin-bottom: 30px;
}

.notification-center-header h1 {
    font-size: 2rem;
    color: var(--color-text-primary);
    margin: 0 0 10px 0;
}

.notification-center-header p {
    font-size: 1rem;
    color: #7f8c8d;
    margin: 0;
}

/* Filter Tabs */
.notification-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.filter-tab {
    padding: 12px 16px;
    border: none;
    background: none;
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

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

.filter-tab.active {
    color: #2196f3;
    border-bottom-color: #2196f3;
}

/* Notifications List */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.notification-item {
    background: white;
    border-left: 4px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: all 0.2s ease;
}

.notification-item.unread {
    background: #f5f7fa;
    border-left-color: #2196f3;
}

.notification-item.important {
    border-left-color: #ff9800;
    background: #fff8f0;
}

.notification-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

.notification-message {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.notification-time {
    color: #99a3a8;
    font-size: 0.8rem;
}

.notification-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e0e0e0;
}

/* Notification Actions Bar */
.notification-actions-bar {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.notification-actions-bar .btn {
    flex: 1;
}

/* Sidebar Sections */
.notification-sidebar-section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.notification-sidebar-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Action Button */
.action-button {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    border-color: #2196f3;
    background: #f5f7fa;
    color: #2196f3;
}

/* Preference Group */
.preference-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preference-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    color: var(--color-text-primary);
    font-size: 0.9rem;
}

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

.preference-item:hover {
    color: #2196f3;
}

/* Empty State */
.notification-center .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: white;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 1023px) {
    .notification-filters {
        flex-wrap: wrap;
    }

    .notification-item {
        flex-direction: column;
    }

    .notification-actions {
        justify-content: flex-end;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .notification-center-header h1 {
        font-size: 1.5rem;
    }

    .notification-item {
        gap: 8px;
        padding: 12px;
    }

    .notification-icon {
        width: 40px;
        height: 40px;
    }

    .notification-title {
        font-size: 0.95rem;
    }

    .notification-message {
        font-size: 0.85rem;
    }
}


/* ============================================
   FORM LOADING STATES & FEEDBACK
   ============================================ */

/* Button Loading States */
.btn.loading,
.btn.is-loading {
    opacity: 0.8;
    pointer-events: none;
    position: relative;
    cursor: wait;
}

.btn.loading::before,
.btn.is-loading::before {
    content: 'Laddar...';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show loading text when button text is hidden */
.btn.loading.hide-text::before,
.btn.is-loading.hide-text::before {
    opacity: 1;
}

.btn.loading.hide-text > span:not(.sr-only),
.btn.is-loading.hide-text > span:not(.sr-only) {
    opacity: 0;
}

.btn.loading::after,
.btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.btn.btn-secondary.loading::after,
.btn.btn-secondary.is-loading::after {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}

/* Inline button loading with text preserved */
.btn.loading-inline::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    opacity: 0.7;
}

/* Form Validation Messages */
.form-validation-message {
    display: none;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.form-validation-message.success {
    display: block;
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.form-validation-message.warning {
    display: block;
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.form-validation-message.error {
    display: block;
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.form-validation-message.info {
    display: block;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

/* Form Field Loading State */
.form-group.loading input,
.form-group.loading textarea,
.form-group.loading select {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group.loading input:disabled,
.form-group.loading textarea:disabled,
.form-group.loading select:disabled {
    background-color: #f5f5f5;
}

/* Character Counter Styles */
.char-counter {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}

.char-counter.warning {
    color: #ff9800;
}

.char-counter.success {
    color: #4caf50;
}

.char-counter.danger {
    color: #f44336;
}

/* Input Helper Text */
.form-helper-text {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 6px;
    margin-left: 4px;
}

.form-helper-text.error {
    color: #f44336;
    font-weight: 500;
}

.form-helper-text.success {
    color: #4caf50;
    font-weight: 500;
}

/* Form Field Focus State */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-input.success:focus,
.form-textarea.success:focus,
.form-select.success:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Loading Spinner for Modals */
.modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 100;
}

.modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
}

/* Page Loading Indicator */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop, 9000);
}

.page-loading-overlay.hide {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 12px;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #999;
}

/* Inline Loading Indicator */
.inline-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.success-checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    animation: scaleIn 0.5s ease;
}

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

/* Pulse Animation for Attention */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Field Label Focus State */
label.focused {
    color: #2196f3;
    font-weight: 600;
}

/* Form Section Loading */
.form-section.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.form-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   HEADER NOTIFICATION BUTTON
   ============================================ */

.header-notification-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    margin-right: 15px;
    display: none;
}

.header-notification-btn:hover {
    opacity: 0.8;
}

.header-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-error, #e74c3c);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.header-notification-badge.has-notifications {
    display: flex;
}

/* ============================================
   BUTTON OUTLINE VARIANTS
   ============================================ */

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-primary, #3498db);
    color: var(--color-primary, #3498db);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background: var(--color-primary, #3498db);
    color: white;
}

/* Header Buttons - for blue header background */
.header-guest-buttons {
    display: flex;
    gap: 10px;
}

.btn-header-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-header-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
}

.btn-header-primary {
    background: white;
    border: none;
    color: var(--color-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-header-primary:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--color-error, #e74c3c);
    color: var(--color-error, #e74c3c);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-danger:hover {
    background: var(--color-error, #e74c3c);
    color: white;
}

.btn-outline-success {
    background: transparent;
    border: 2px solid var(--color-success, #27ae60);
    color: var(--color-success, #27ae60);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-success:hover {
    background: var(--color-success, #27ae60);
    color: white;
}

/* ============================================
   PAGE HEADER BLUE STYLING
   ============================================ */

.page-header-blue {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.page-header-blue h1 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.page-header-blue p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 1rem;
}

/* Page Header Internal Layout - replaces inline styles */
.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header-title-section h1 {
    color: white;
    margin: 0 0 6px 0;
    font-weight: 600;
}

.page-header-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin: 0;
}

.page-header-stats {
    display: flex;
    gap: 15px;
}

/* Action Legend Row - Desktop defaults */
.action-legend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 0 15px 0;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.available,
.legend-color.open {
    background: #d4edda;
    border: 2px solid #28a745;
}

.legend-color.booked {
    background: #ffebee;
    border: 2px solid var(--color-error);
}

.legend-color.in-progress {
    background: #d1ecf1;
    border: 2px solid var(--color-primary);
}

.legend-color.completed {
    background: #e2e3e5;
    border: 2px solid #6c757d;
}

.legend-text {
    color: #666;
}

@media (max-width: 767px) {
    .page-header-blue {
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }

    .page-header-blue h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   iOS-STYLE SEGMENT CONTROL - Reusable
   ============================================ */

/* Wrapper for centering */
.availability-segment-wrapper,
.segment-control-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

/* The segment control container */
.availability-segment-control,
.segment-control {
    display: inline-flex;
    background: #f1f3f4;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

/* Individual segment buttons */
.availability-segment,
.segment {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
    justify-content: center;
}

.availability-segment:hover,
.segment:hover {
    background: rgba(0, 0, 0, 0.05);
}

.availability-segment.active,
.segment.active {
    background: var(--color-primary);
    color: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.availability-segment.active .segment-label,
.segment.active .segment-label {
    color: white !important;
}

/* Segment label */
.segment-label {
    white-space: nowrap;
}

/* Segment count badge */
.segment-count {
    background: #e8eaed;
    color: #5f6368;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.availability-segment.active .segment-count,
.segment.active .segment-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .availability-segment-control,
    .segment-control,
    .notification-segment-control {
        width: 100%;
    }

    .availability-segment,
    .segment,
    .notification-segment {
        flex: 1;
        padding: 12px 10px;
        font-size: 0.85rem;
        min-width: auto;
    }

    .segment-count {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Notification segment control (extends base) */
.notification-segment-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.notification-segment-control {
    display: inline-flex;
    background: #f1f3f4;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
}

.notification-segment {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-segment:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notification-segment.active {
    background: white;
    color: #1a73e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-weight: 600;
}

