/* © 2025 VEX LLC. All rights reserved. */
/* ===================================================================
   TELECONSULTA.CSS - Video Call, Waiting Room, Controls, Steps
   =================================================================== */

        /* Video Call */
        .video-container { width: 100%; aspect-ratio: 16/9; background: #1F2937; border-radius: 16px; overflow: hidden; }
        .video-container iframe { width: 100%; height: 100%; border: none; }
        .call-controls { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
        .call-btn { width: 56px; height: 56px; border-radius: 28px; border: none; font-size: 22px; cursor: pointer; }
        .call-btn.mute { background: #374151; color: white; }
        .call-btn.end { background: var(--danger); color: white; }

        /* ═══════════════════════════════════════════════════════════════════
           IMPROVED VIDEO CONSULTATION UI
           ═══════════════════════════════════════════════════════════════════ */

        /* Step indicator */
        .consultation-steps {
            display: flex;
            justify-content: space-between;
            margin-bottom: 24px;
            padding: 0 10px;
        }
        .step-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex: 1;
            position: relative;
        }
        .step-item:not(:last-child)::after {
            content: '';
            position: absolute;
            top: 16px;
            left: 60%;
            width: 80%;
            height: 2px;
            background: var(--border);
        }
        .step-item.completed:not(:last-child)::after {
            background: var(--primary);
        }
        .step-circle {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-light);
            position: relative;
            z-index: 1;
            transition: all 0.3s;
        }
        .step-item.active .step-circle {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 12px rgba(75,123,245,0.4);
        }
        .step-item.completed .step-circle {
            background: #22C55E;
            color: white;
        }
        .step-label {
            font-size: 10px;
            color: var(--text-light);
            margin-top: 6px;
            text-align: center;
        }
        .step-item.active .step-label {
            color: var(--primary);
            font-weight: 600;
        }

        /* Pre-call device check */
        .device-check {
            background: #F8FAFC;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
        }
        .device-check-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .device-preview {
            width: 100%;
            aspect-ratio: 4/3;
            background: #1F2937;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            margin-bottom: 16px;
        }
        .device-preview video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }
        .device-preview-placeholder {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            gap: 12px;
        }
        .device-preview-placeholder .icon {
            font-size: 48px;
            opacity: 0.5;
        }
        .device-status {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
        }
        .device-status-item {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px;
            background: white;
            border-radius: 10px;
            font-size: 13px;
        }
        .device-status-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }
        .device-status-icon.success { background: #D1FAE5; }
        .device-status-icon.error { background: #FEE2E2; }
        .device-status-icon.loading { background: #E0F2FE; animation: pulse 1.5s infinite; }

        /* Improved waiting room */
        .waiting-room {
            text-align: center;
            padding: 30px 20px;
        }
        .waiting-animation {
            width: 120px;
            height: 120px;
            margin: 0 auto 24px;
            position: relative;
        }
        .waiting-pulse {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: var(--primary-light);
            animation: waitingPulse 2s ease-in-out infinite;
        }
        .waiting-pulse:nth-child(2) { animation-delay: 0.5s; }
        .waiting-pulse:nth-child(3) { animation-delay: 1s; }
        @keyframes waitingPulse {
            0%, 100% { transform: scale(0.8); opacity: 0.8; }
            50% { transform: scale(1.2); opacity: 0; }
        }
        .waiting-icon {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            z-index: 1;
        }
        .waiting-status {
            font-size: 18px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 8px;
        }
        .waiting-timer {
            font-size: 42px;
            font-weight: 800;
            color: var(--primary);
            margin: 16px 0;
            font-variant-numeric: tabular-nums;
        }
        .waiting-info {
            background: #F0FDF4;
            border-radius: 12px;
            padding: 16px;
            margin: 20px 0;
        }
        .waiting-info-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            font-size: 14px;
        }
        .waiting-info-item:not(:last-child) {
            border-bottom: 1px solid #D1FAE5;
        }
        .waiting-tips {
            margin-top: 20px;
            padding: 16px;
            background: #FEF3C7;
            border-radius: 12px;
            text-align: left;
        }
        .waiting-tips-title {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .waiting-tips ul {
            margin: 0;
            padding-left: 20px;
            font-size: 13px;
            color: #92400E;
        }
        .waiting-tips li { margin: 4px 0; }

        /* Improved video call UI */
        .video-call-container {
            position: relative;
            background: #0F172A;
            border-radius: 20px;
            overflow: hidden;
            margin: -16px -16px 0;
            min-height: calc(100vh - 180px);
        }
        .video-main {
            width: 100%;
            height: calc(100vh - 250px);
            background: #1E293B;
        }
        .video-main iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
        .video-self-preview {
            position: absolute;
            top: 16px;
            right: 16px;
            width: 100px;
            height: 140px;
            background: #374151;
            border-radius: 12px;
            overflow: hidden;
            border: 3px solid white;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        .video-self-preview video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }
        .video-call-header {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 16px;
            background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
        }
        .video-call-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .video-call-avatar {
            width: 40px;
            height: 40px;
            border-radius: 20px;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }
        .video-call-name { font-weight: 600; font-size: 15px; }
        .video-call-duration { font-size: 13px; opacity: 0.8; }
        .video-connection-status {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            padding: 6px 12px;
            background: rgba(34,197,94,0.2);
            border-radius: 20px;
        }
        .connection-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #22C55E;
            animation: connectionPulse 2s infinite;
        }
        .connection-dot.warning { background: #FACC15; }
        .connection-dot.error { background: #EF4444; }
        @keyframes connectionPulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .video-call-controls {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 20px;
            background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
            display: flex;
            justify-content: center;
            gap: 16px;
        }
        .video-control-btn {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            border: none;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .video-control-btn.active {
            background: white;
            color: #1F2937;
        }
        .video-control-btn.muted {
            background: #374151;
            color: white;
        }
        .video-control-btn.muted::after {
            content: '';
            position: absolute;
            width: 3px;
            height: 30px;
            background: #EF4444;
            transform: rotate(45deg);
            border-radius: 2px;
        }
        .video-control-btn.end-call {
            background: #EF4444;
            color: white;
            width: 64px;
            height: 64px;
        }
        .video-control-btn:active { transform: scale(0.9); }
        .video-control-btn.more {
            background: #374151;
            color: white;
        }

        /* Call ended screen */
        .call-ended {
            text-align: center;
            padding: 40px 20px;
        }
        .call-ended-icon {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
            background: #D1FAE5;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
        }
        .call-ended-title {
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 8px;
        }
        .call-ended-duration {
            font-size: 14px;
            color: var(--text-light);
            margin-bottom: 24px;
        }
        .call-summary {
            background: #F8FAFC;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            text-align: left;
        }
        .call-summary-title {
            font-weight: 600;
            margin-bottom: 12px;
        }
        .call-summary-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 14px;
            border-bottom: 1px solid var(--border);
        }
        .call-summary-item:last-child { border: none; }
        .rating-stars {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 20px 0;
        }
        .rating-star {
            font-size: 32px;
            cursor: pointer;
            transition: transform 0.2s;
            filter: grayscale(1);
        }
        .rating-star:hover, .rating-star.active {
            transform: scale(1.2);
            filter: none;
        }

        /* ═══════════════════════════════════════════════════════════════════
           VIDEO CALL FULLSCREEN - MOBILE & DESKTOP
           ═══════════════════════════════════════════════════════════════════ */

        /* When video call is active */
        body.video-call-active {
            overflow: auto;
        }

        body.video-call-active .bottom-nav,
        body.video-call-active .header,
        body.video-call-active .desktop-sidebar,
        body.video-call-active .desktop-header,
        body.video-call-active .fab-container {
            display: none !important;
        }

        /* Hide consultation header, steppers and pricing banner during call */
        body.video-call-active #consultaHeader,
        body.video-call-active #consultaSteps,
        body.video-call-active #consultaPricingBanner {
            display: none !important;
        }

        body.video-call-active .main-content {
            margin-left: 0 !important;
            padding-top: 0 !important;
        }

        /* Desktop Video Call - Allow scroll and proper sizing */
        body.video-call-active .screen {
            padding: 0 !important;
            max-width: none !important;
        }

        body.video-call-active #screenConsultaOnline > div {
            padding: 0 !important;
        }

        body.video-call-active .video-call-container {
            margin: 0 !important;
            border-radius: 0 !important;
            min-height: 100vh;
        }

        body.video-call-active .video-main {
            height: calc(100vh - 180px);
            min-height: 500px;
        }

        body.video-call-active .video-main iframe {
            width: 100%;
            height: 100%;
        }

        /* Mobile Fullscreen Video */
        @media (max-width: 768px) {
            body.video-call-active {
                overflow: hidden;
            }

            body.video-call-active .video-call-container {
                position: fixed !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                width: 100vw !important;
                height: 100vh !important;
                z-index: 9999 !important;
                border-radius: 0 !important;
                margin: 0 !important;
            }

            body.video-call-active .video-main {
                height: 100vh !important;
            }

            body.video-call-active .video-main iframe {
                width: 100% !important;
                height: 100% !important;
            }

            body.video-call-active #vetMockBanner {
                position: absolute;
                top: 60px;
                left: 8px;
                right: 8px;
                z-index: 10001;
                margin: 0 !important;
            }

            body.video-call-active .video-call-header {
                z-index: 10002;
            }

            /* Copy link button repositioned */
            body.video-call-active [onclick="compartilharLinkSala()"] {
                position: fixed !important;
                bottom: 80px !important;
                left: 16px !important;
                right: 16px !important;
                z-index: 10001 !important;
                margin: 0 !important;
                padding: 14px !important;
            }
        }

        /* Call Ending Transition Screen */
        .call-ending-overlay {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
            z-index: 10000;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
        }

        .call-ending-overlay.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .call-ending-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
            border-radius: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            margin-bottom: 24px;
            animation: scaleIn 0.5s ease;
        }

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

        .call-ending-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .call-ending-subtitle {
            font-size: 14px;
            color: rgba(255,255,255,0.7);
            margin-bottom: 32px;
        }

        .call-ending-loader {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(255,255,255,0.2);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Participant Left Toast */
        .participant-toast {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.85);
            color: white;
            padding: 12px 24px;
            border-radius: 30px;
            display: none;
            align-items: center;
            gap: 10px;
            z-index: 10003;
            font-size: 14px;
            font-weight: 500;
            backdrop-filter: blur(10px);
            animation: slideDown 0.3s ease;
        }

        .participant-toast.active {
            display: flex;
        }

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

        .participant-toast-icon {
            width: 28px;
            height: 28px;
            background: var(--primary);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        /* Rating Modal Overlay */
        .rating-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            z-index: 10001;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }

        .rating-modal-overlay.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .rating-modal {
            background: white;
            border-radius: 24px;
            padding: 32px 24px;
            width: 100%;
            max-width: 420px;
            max-height: 90vh;
            overflow-y: auto;
            animation: scaleIn 0.3s ease;
        }

        @media (max-width: 768px) {
            .rating-modal {
                max-width: none;
                max-height: none;
                height: 100%;
                border-radius: 0;
                padding: 24px 20px;
                display: flex;
                flex-direction: column;
            }
        }

        .rating-modal-header {
            text-align: center;
            margin-bottom: 24px;
        }

        .rating-modal-avatar {
            width: 80px;
            height: 80px;
            border-radius: 40px;
            background: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            margin: 0 auto 16px;
            border: 3px solid var(--primary);
        }

        .rating-modal-vet-name {
            font-size: 18px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 4px;
        }

        .rating-modal-subtitle {
            font-size: 14px;
            color: var(--text-light);
        }

        .rating-modal-question {
            font-size: 16px;
            font-weight: 600;
            text-align: center;
            color: var(--text);
            margin-bottom: 16px;
        }

        .rating-modal-stars {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-bottom: 24px;
        }

        .rating-modal-star {
            font-size: 40px;
            cursor: pointer;
            transition: all 0.2s;
            filter: grayscale(1);
        }

        .rating-modal-star:hover,
        .rating-modal-star.active {
            transform: scale(1.2);
            filter: none;
        }

        .rating-modal-categories {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-bottom: 20px;
        }

        .rating-category-chip {
            padding: 8px 16px;
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            color: var(--text);
        }

        .rating-category-chip:hover,
        .rating-category-chip.selected {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .rating-modal-comment {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid var(--border);
            border-radius: 12px;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            min-height: 100px;
            margin-bottom: 20px;
        }

        .rating-modal-comment:focus {
            outline: none;
            border-color: var(--primary);
        }

        .rating-modal-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        @media (max-width: 768px) {
            .rating-modal-actions {
                margin-top: auto;
            }
        }

        .rating-modal-skip {
            background: transparent;
            border: none;
            color: var(--text-light);
            font-size: 14px;
            cursor: pointer;
            padding: 12px;
        }

        .rating-modal-skip:hover {
            color: var(--text);
        }
