﻿/* ===============================================
   HyperPlumb V2 - Combined Mobile-Optimized Stylesheet
   Merges V2 base styles with enhanced modal/messaging features
   =============================================== */

/* ===============================================
   ROOT VARIABLES & THEME
   =============================================== */
:root {
    /* Brand Colors */
    --primary-color: #00152a;
    --secondary-color: #03defe;
    --accent-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --black: #000000;
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    /* Box Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.16);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
}

/* ===============================================
   BASE STYLES
   =============================================== */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
}

/* ===============================================
   LAYOUT COMPONENTS
   =============================================== */
.container-fluid {
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -1rem;
    margin-left: -1rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 1rem;
    padding-left: 1rem;
}

.col-md-4 {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
    padding-right: 1rem;
    padding-left: 1rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 1rem;
    padding-left: 1rem;
}

.col-md-8 {
    flex: 0 0 66.66667%;
    max-width: 66.66667%;
    padding-right: 1rem;
    padding-left: 1rem;
}

/* ===============================================
   CARD COMPONENTS
   =============================================== */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background: var(--white);
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,0.125);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.125);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    font-weight: 600;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.card-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0,0,0,0.03);
    border-top: 1px solid rgba(0,0,0,0.125);
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
}

/* ===============================================
   FORM STYLES
   =============================================== */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dark-gray);
    background: var(--white);
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus {
        color: var(--dark-gray);
        background: var(--white);
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    }

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 2.25rem 0.75rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dark-gray);
    background: var(--white) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/16px 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* ===============================================
   BUTTON STYLES
   =============================================== */
.btn {
    display: inline-block;
    font-weight: 500;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .btn:hover {
        color: #212529;
        text-decoration: none;
    }

    .btn:focus {
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

.btn-primary {
    color: #fff;
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

    .btn-primary:hover {
        color: #fff;
        background: #0056b3;
        border-color: #004085;
    }

.btn-secondary {
    color: #fff;
    background: var(--medium-gray);
    border-color: var(--medium-gray);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    color: #fff;
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    color: #fff;
    background: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: var(--shadow-sm);
}

.btn-warning {
    color: #000;
    background: var(--warning-color);
    border-color: var(--warning-color);
    box-shadow: var(--shadow-sm);
}

.btn-info {
    color: #fff;
    background: var(--info-color);
    border-color: var(--info-color);
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    border-radius: var(--border-radius-lg);
}

.btn:disabled, .btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===============================================
   MAP CONTAINER STYLES
   =============================================== */
#map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius-md);
    border: 1px solid #dee2e6;
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

#map-container.blurred {
    filter: blur(4px) brightness(0.7);
    transition: filter 0.3s ease;
}

.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--light-gray);
    color: var(--medium-gray);
    font-size: 1.1rem;
}

.map-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

/* ===============================================
   ENHANCED MODAL STYLES (From Reference)
   =============================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
}

    .modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1rem;
    max-width: 500px;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: var(--white);
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    background: var(--primary-color);
    color: white;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 600;
    font-size: 1.2rem;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    gap: 0.5rem;
}

.close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    text-shadow: none;
    opacity: 0.7;
    cursor: pointer;
}

    .close:hover {
        opacity: 1;
    }

/* ===============================================
   ENHANCED MESSAGING SYSTEM
   =============================================== */

/* Floating Message Button */
.floating-message-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    animation: pulse 2s infinite;
}

    .floating-message-btn .btn {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        border: none;
        background: var(--accent-color);
        box-shadow: var(--shadow-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        position: relative;
        color: white;
    }

        .floating-message-btn .btn:hover {
            background: #0056b3;
            transform: scale(1.05);
        }

    .floating-message-btn .unread-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: var(--danger-color);
        color: white;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: bold;
        border: 2px solid white;
        animation: bounce 0.6s ease-in-out;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    80% {
        transform: translateY(-5px);
    }
}

@keyframes pulse-1 {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Messaging Modal - Mobile Optimized */
.messaging-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1060;
    align-items: flex-end;
    justify-content: center;
}

    .messaging-modal.show {
        display: flex;
    }

.messaging-modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    height: 70vh;
    max-height: 600px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    margin: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Message Header */
.message-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

    .message-header h5 {
        margin: 0;
        font-weight: 600;
        font-size: 1.1rem;
    }

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

    .close-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message Bubbles */
.message-bubble {
    display: flex;
    margin-bottom: 1rem;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.customer-message {
    justify-content: flex-end;
}

.technician-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}

.customer-message .message-content {
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.technician-message .message-content {
    background: white;
    color: var(--dark-gray);
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

/* Message Input Area */
.message-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
}

    .message-input:focus {
        outline: none;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

.send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

    .send-btn:hover {
        background: #0056b3;
        transform: scale(1.05);
    }

    .send-btn:disabled {
        background: var(--medium-gray);
        cursor: not-allowed;
        transform: none;
    }

/* ===============================================
   ALERTS & NOTIFICATIONS
   =============================================== */
.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
}

.alert-success {
    color: #155724;
    background: #d4edda;
    border-color: var(--success-color);
}

.alert-warning {
    color: #856404;
    background: #fff3cd;
    border-color: var(--warning-color);
}

.alert-danger {
    color: #721c24;
    background: #f8d7da;
    border-color: var(--danger-color);
}

.alert-info {
    color: #0c5460;
    background: #d1ecf1;
    border-color: var(--info-color);
}

/* ===============================================
   CONNECTION STATUS INDICATOR
   =============================================== */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border: 2px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    z-index: 1000;
}

    .connection-status.connected {
        background: #d4edda;
        color: #155724;
        border-color: #c3e6cb;
    }

    .connection-status.disconnected {
        background: #f8d7da;
        color: #721c24;
        border-color: #f5c6cb;
    }

/* ===============================================
   UTILITY CLASSES
   =============================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--accent-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-muted {
    color: var(--medium-gray) !important;
}

.bg-primary {
    background-color: var(--accent-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    color: var(--danger-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.m-0 {
    margin: 0 !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.p-0 {
    padding: 0 !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

/* ===============================================
   SPINNER/LOADING
   =============================================== */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ===============================================
   ERROR BOUNDARY
   =============================================== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE8NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ===============================================
    CONFIRMATION
   =============================================== */

.shake-modal {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}


/* Technician marker breathing animation */
@keyframes breathe {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) scale(1.08);
        opacity: 0.85;
    }
}

.proceed-breathing {
    animation: breathe 2.5s ease-in-out infinite;
}

.proceed-tech-btn:hover.proceed-breathing {
    animation-play-state: paused;
    background-color: #0056b3;
}

.proceed-tech-btn:active {
    transform: translateX(-50%) scale(0.95);
    background-color: #004080;
}

/* After payment - messaging mode */
.proceed-tech-btn.payment-mode {
    animation: none;
    background-color: #28a745;
}

    .proceed-tech-btn.payment-mode:hover {
        background-color: #218838;
    }


/* Success pulse animation for payment confirmation */
.success-pulse {
    animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.service-request-confirmation {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-md);
    margin: 1rem;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirmation-header {
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .confirmation-header h4 {
        margin: 0;
        font-size: 1.1rem;
    }

.status-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.confirmation-details {
    padding: 1.5rem;
}

.detail-item {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

    .detail-item:last-child {
        margin-bottom: 0;
    }

    .detail-item strong {
        color: var(--dark-gray);
        display: inline-block;
        min-width: 80px;
    }

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */
@media (max-width: 768px) {
    .container-fluid {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .row {
        margin-right: -0.5rem;
        margin-left: -0.5rem;
    }

    .col-12, .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        flex: 0 0 100%;
        max-width: 100%;
    }

    .card {
        margin: 0.5rem 0;
    }

    .card-header, .card-body, .card-footer {
        padding: 0.75rem 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-width: none;
    }

    .messaging-modal-content {
        height: 85vh;
        border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    }

    .message-content {
        max-width: 90%;
    }

    #map-container {
        height: 300px;
    }

    .floating-message-btn {
        bottom: 15px;
        right: 15px;
    }

        .floating-message-btn .btn {
            width: 55px;
            height: 55px;
        }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.125rem;
    }
}

/* Desktop Enhancements for Messaging */
@media (min-width: 769px) {
    .messaging-modal {
        align-items: center;
        justify-content: center;
    }

    .messaging-modal-content {
        max-width: 600px;
        height: 600px;
        border-radius: var(--border-radius-lg);
        margin: 2rem;
        animation: fadeInScale 0.3s ease-out;
    }

    @keyframes fadeInScale {
        from {
            transform: scale(0.9);
            opacity: 0;
        }

        to {
            transform: scale(1);
            opacity: 1;
        }
    }

    .floating-message-btn .btn:hover {
        transform: scale(1.1);
    }

    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .col-md-4 {
        flex: 0 0 33.33333%;
        max-width: 33.33333%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-8 {
        flex: 0 0 66.66667%;
        max-width: 66.66667%;
    }
}

/* ================================================
               Markers
   ================================================ */

.service-request-bubble {
    position: relative;
    background: #fff;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    min-width: 120px;
    text-align: center;
    cursor: pointer;
}

.bubble-content {
    color: #333;
    font-size: 12px;
    line-height: 1.2;
}

.request-number {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 2px;
}

.request-details {
    color: #666;
    margin-bottom: 2px;
}

.request-priority {
    color: #dc3545;
    font-size: 10px;
    font-weight: bold;
}

.bubble-pointer {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #007bff;
}

.service-request-bubble:hover {
    background: #f8f9fa;
    border-color: #0056b3;
}


/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-gray);
    }

    .message-content {
        border: 2px solid var(--dark-gray);
    }

    .btn {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .message-bubble,
    .spinner-border,
    .messaging-modal-content,
    .floating-message-btn .btn {
        animation: none !important;
        transition: none !important;
    }
}
/* ===================================================================
   MESSAGING COMPONENT STYLES
   =================================================================== */

/* Messages Container */
.messages-container {
    background-color: #f8f9fa;
}

/* Empty State */
.no-messages {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

    .no-messages i {
        font-size: 4rem;
        margin-bottom: 1rem;
        color: #dee2e6;
    }

/* Message Bubbles */
.message-bubble {
    margin-bottom: 1rem;
    max-width: 85%;
    word-wrap: break-word;
    clear: both;
}

    .message-bubble.customer-message {
        margin-left: auto;
        margin-right: 0;
        float: right;
    }

    .message-bubble.tech-message {
        margin-left: 0;
        margin-right: auto;
        float: left;
    }

/* Message Content */
.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
    max-width: 100%;
}

.customer-message .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 0.3rem;
}

.tech-message .message-content {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 0.3rem;
    border: 1px solid #ddd;
}

/* Message Info (timestamp, sender, status) */
.message-info {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.customer-message .message-info {
    justify-content: flex-end;
    text-align: right;
}

.tech-message .message-info {
    justify-content: flex-start;
    text-align: left;
}

.sender-name {
    font-weight: 500;
    color: #495057;
}

.timestamp {
    opacity: 0.8;
    font-size: 0.7rem;
}

/* Delivery Status Icons */
.delivery-status {
    color: #28a745;
    font-weight: bold;
    margin-left: 0.25rem;
    font-size: 0.8rem;
}

/* Connection Status Badge */
.connection-status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Message Input Area */
.message-input-container {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

.message-character-count {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Loading States */
.messages-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

    .messages-loading .spinner-border {
        margin-bottom: 1rem;
    }

/* Error States */
.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 1rem;
}

/* Hover Effects */
.message-bubble:hover {
    transform: translateY(-1px);
    transition: transform 0.1s ease-in-out;
}

.customer-message:hover .message-content {
    background-color: #0056b3;
}

.tech-message:hover .message-content {
    background-color: #e2e6ea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 90%;
    }

    .message-content {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .message-info {
        font-size: 0.7rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {
    .message-bubble {
        max-width: 95%;
    }

    .message-content {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .no-messages {
        padding: 2rem 0.5rem;
    }

        .no-messages i {
            font-size: 3rem;
        }
}

/* Animation for new messages */
@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.new-message {
    animation: slideInMessage 0.3s ease-out;
}

/* Typing indicator (for future use) */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #6c757d;
    font-style: italic;
    font-size: 0.8rem;
}

    .typing-indicator .typing-dots {
        display: inline-flex;
        margin-left: 0.5rem;
    }

        .typing-indicator .typing-dots span {
            height: 6px;
            width: 6px;
            background-color: #6c757d;
            border-radius: 50%;
            margin: 0 1px;
            animation: typing 1.4s infinite ease-in-out;
        }

            .typing-indicator .typing-dots span:nth-child(1) {
                animation-delay: -0.32s;
            }

            .typing-indicator .typing-dots span:nth-child(2) {
                animation-delay: -0.16s;
            }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Modal Specific Styles */
.message-modal .modal-header {
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.message-modal .modal-body {
    padding: 0;
}

.message-modal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Utility Classes for Messages */
.message-time-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

    .message-time-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background-color: #dee2e6;
        z-index: 1;
    }

    .message-time-divider span {
        background-color: #f8f9fa;
        padding: 0 1rem;
        font-size: 0.7rem;
        color: #6c757d;
        position: relative;
        z-index: 2;
    }

/* Focus states for accessibility */
.message-input-container input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #80bdff;
}

.message-input-container button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tech-message .message-content {
        border: 2px solid #000;
    }

    .customer-message .message-content {
        background-color: #0056b3;
        border: 2px solid #003d82;
    }

    .message-info {
        color: #000;
    }
}