/**
 * TAM Demo - Estilos del Emulador Interactivo
 */

/* =====================
   Demo Selector
   ===================== */
.demo-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.demo-intro h2 {
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.demo-intro p {
    color: var(--gray-600);
}

.demo-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .demo-selector {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

.demo-option {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.demo-option:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.demo-option-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-option-icon.icon-access {
    background: rgba(45, 90, 135, 0.1);
    color: var(--primary);
}

.demo-option-icon.icon-alarm {
    background: rgba(220, 53, 69, 0.1);
    color: var(--alert);
}

.demo-option-icon.icon-guard {
    background: rgba(194, 112, 58, 0.1);
    color: var(--orange);
}

.demo-option h3 {
    margin-bottom: 0.25rem;
    color: var(--gray-900);
    font-size: 1.5rem;
}

.demo-option-subtitle {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.demo-option-desc {
    color: var(--gray-700);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.demo-option-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.demo-option-features li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.demo-option-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.demo-option-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}

.demo-option:hover .demo-option-cta {
    background: var(--primary-dark);
}

.demo-note {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.demo-note p {
    color: var(--gray-600);
    margin: 0;
}

/* =====================
   Demo Page Layout
   ===================== */
.demo-page {
    min-height: 100vh;
    padding-top: 70px;
    background: var(--gray-100);
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

@media (max-width: 1024px) {
    .demo-container {
        grid-template-columns: 1fr;
    }
}

/* =====================
   Emulador Base
   ===================== */
.demo-emulator {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.emulator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.emulator-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emulator-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* =====================
   ACCESS Emulator - Puertas
   ===================== */
.access-visual {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 2rem;
    background: linear-gradient(180deg, #e8f4fd 0%, #f8f9fa 100%);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .access-visual {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
}

.door-unit,
.gate-unit {
    text-align: center;
}

/* Puerta Peatonal */
.door-frame {
    width: 100px;
    height: 180px;
    background: #8B4513;
    border: 6px solid #5D3A1A;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.door-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 50%, #654321 100%);
    transform-origin: left center;
    transition: transform 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.door-panel::before {
    content: "";
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
    position: absolute;
    right: 15px;
    top: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.door-panel.open {
    transform: perspective(500px) rotateY(-75deg);
}

.door-floor {
    width: 120px;
    height: 10px;
    background: #696969;
    margin: 0 auto;
    border-radius: 0 0 4px 4px;
}

.door-label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.door-status {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.door-status.open {
    color: var(--accent);
    font-weight: 600;
}

/* Reja Vehicular */
.gate-frame {
    width: 180px;
    height: 120px;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);
    border: 6px solid #696969;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
}

.gate-panel {
    width: 50%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #2F4F4F 0px,
        #2F4F4F 8px,
        transparent 8px,
        transparent 16px
    );
    transition: transform 0.8s ease-in-out;
}

.gate-panel.left {
    transform-origin: left center;
}

.gate-panel.right {
    transform-origin: right center;
}

.gate-frame.open .gate-panel.left {
    transform: translateX(-100%);
}

.gate-frame.open .gate-panel.right {
    transform: translateX(100%);
}

.gate-floor {
    width: 200px;
    height: 15px;
    background: linear-gradient(90deg, #696969 0%, #808080 50%, #696969 100%);
    margin: 0 auto;
    border-radius: 0 0 4px 4px;
}

/* Botones de Control */
.emulator-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.control-btn.primary:hover {
    background: var(--primary-dark);
}

.control-btn.secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.control-btn.secondary:hover {
    background: var(--gray-300);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Log de Eventos */
.event-log {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.event-log h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

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

.event-time {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.event-text {
    color: var(--gray-600);
}

/* =====================
   AmberLITE - Alarma
   ===================== */
.alarm-visual {
    text-align: center;
    padding: 2rem;
}

.alarm-panel {
    display: inline-block;
    padding: 2rem 3rem;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.alarm-status {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.alarm-status.triggered {
    color: var(--alert);
    animation: alarmBlink 0.5s infinite;
}

@keyframes alarmBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.panic-button {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(145deg, #dc3545, #c82333);
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(220, 53, 69, 0.4);
    transition: transform 0.1s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(220, 53, 69, 0.5);
}

.panic-button:active {
    transform: scale(0.95);
}

.panic-button.triggered {
    animation: panicPulse 0.3s infinite;
}

@keyframes panicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Telefonos de Vecinos */
.neighbors-section {
    margin-top: 2rem;
}

.neighbors-section h4 {
    text-align: center;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.neighbors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

@media (max-width: 500px) {
    .neighbors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.neighbor-phone {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 6px;
    aspect-ratio: 9/16;
    max-height: 200px;
}

.neighbor-screen {
    background: linear-gradient(180deg, #2d5a87 0%, #1e3a5f 100%);
    border-radius: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.neighbor-name {
    font-size: 0.65rem;
    opacity: 0.8;
    position: absolute;
    top: 0.5rem;
}

.neighbor-status {
    font-size: 0.7rem;
    opacity: 0.6;
}

.neighbor-alert {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(220, 53, 69, 0.95);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: slideDown 0.3s ease-out;
    padding: 0.5rem;
}

.neighbor-alert.active {
    display: flex;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.neighbor-alert-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.neighbor-alert-text {
    font-size: 0.6rem;
    font-weight: 600;
}

/* =====================
   WebChat Container
   ===================== */
.webchat-panel {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.webchat-header {
    padding: 1rem;
    background: var(--primary);
    color: white;
}

.webchat-header h3 {
    margin: 0;
    font-size: 1rem;
}

.webchat-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.webchat-iframe {
    flex: 1;
    width: 100%;
    border: none;
    min-height: 400px;
}

/* =====================
   CTA Overlay
   ===================== */
.demo-cta {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    max-width: 320px;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.3s ease-out;
    z-index: 100;
}

.demo-cta.visible {
    transform: translateY(0);
    opacity: 1;
}

.demo-cta-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
}

.demo-cta-close:hover {
    color: var(--gray-600);
}

.demo-cta h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.demo-cta p {
    margin: 0 0 1rem 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.demo-cta .btn {
    width: 100%;
}

/* =====================
   Panel de Monitoreo
   ===================== */
.guard-panel {
    background: linear-gradient(180deg, #1e3a5f 0%, #152238 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: white;
}

.guard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.guard-title {
    font-size: 1rem;
    font-weight: 600;
}

.guard-time {
    font-size: 0.875rem;
    opacity: 0.7;
}

.guard-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.guard-control-item {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 1rem;
}

.guard-control-item h4 {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
}

.guard-control-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.guard-control-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.guard-control-dot.closed {
    background: var(--alert);
}

.guard-control-buttons {
    display: flex;
    gap: 0.5rem;
}

.guard-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.guard-btn.open {
    background: var(--accent);
    color: white;
}

.guard-btn.close {
    background: rgba(255,255,255,0.2);
    color: white;
}

.guard-btn:hover {
    opacity: 0.9;
}

.guard-activity {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.guard-activity h4 {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
}

.activity-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    display: flex;
    gap: 0.75rem;
}

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

.activity-time {
    opacity: 0.6;
    white-space: nowrap;
}

.activity-text {
    opacity: 0.9;
}

/* =====================
   Demo Layout (ACCESS) - Emulador + Phone
   ===================== */
.demo-layout {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
    align-items: flex-start;
    justify-content: center;
}

@media (max-width: 900px) {
    .demo-layout {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
    }
}

.demo-emulator-area {
    flex: 1;
    max-width: 600px;
}

.emulator-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.emulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.emulator-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.section-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

/* =====================
   Sliding Doors
   ===================== */
.doors-section {
    margin-bottom: 1.5rem;
}

.doors-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.sliding-door-unit {
    text-align: center;
}

.sliding-door-frame {
    width: 100px;
    height: 140px;
    background: linear-gradient(180deg, #e8f4fd 0%, #d0e8f7 100%);
    border: 4px solid #708090;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.sliding-door-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sliding-door-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #708090 0%, #a0a0a0 50%, #708090 100%);
    border-right: 3px solid #505050;
    transition: transform 0.5s ease-in-out;
}

.sliding-door-panel.open {
    transform: translateX(-90%);
}

.door-opening {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 100%);
    z-index: -1;
}

.door-label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.door-status {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.door-status.open {
    color: var(--accent);
    font-weight: 600;
}

/* =====================
   Vehicle Gate
   ===================== */
.gate-section {
    margin-bottom: 1.5rem;
}

.vehicle-gate-unit {
    text-align: center;
}

.vehicle-gate-frame {
    width: 200px;
    height: 80px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
}

.gate-bar {
    width: 45%;
    height: 12px;
    background: linear-gradient(180deg, #505050 0%, #303030 100%);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.6s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.gate-bar.left {
    left: 5%;
    transform-origin: left center;
}

.gate-bar.right {
    right: 5%;
    transform-origin: right center;
}

.vehicle-gate-frame.open .gate-bar.left {
    transform: translateY(-50%) rotate(-85deg);
}

.vehicle-gate-frame.open .gate-bar.right {
    transform: translateY(-50%) rotate(85deg);
}

.gate-road {
    width: 200px;
    height: 30px;
    background: #404040;
    margin: 0 auto;
    border-radius: 0 0 4px 4px;
    position: relative;
}

.road-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #FFD700 0px,
        #FFD700 20px,
        transparent 20px,
        transparent 40px
    );
    transform: translateY(-50%);
}

/* =====================
   Alarm Section Compact
   ===================== */
.alarm-section-compact {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #152238 100%);
    border-radius: var(--radius);
}

.alarm-section-compact .section-label {
    color: rgba(255,255,255,0.6);
}

.alarm-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    border: 2px solid rgba(125, 161, 119, 0.3);
    transition: all 0.3s;
}

.alarm-display.active {
    border-color: var(--alert);
    background: rgba(220, 53, 69, 0.2);
    animation: alarmGlow 0.5s infinite;
}

@keyframes alarmGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(220, 53, 69, 0.3); }
    50% { box-shadow: 0 0 25px rgba(220, 53, 69, 0.6); }
}

.alarm-indicator {
    color: var(--accent);
    transition: color 0.3s;
}

.alarm-display.active .alarm-indicator {
    color: var(--alert);
    animation: alarmBlink 0.5s infinite;
}

@keyframes alarmBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.alarm-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

/* =====================
   Neighbors Mini
   ===================== */
.neighbors-section-compact {
    padding-top: 0.5rem;
}

.neighbors-mini {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.neighbor-mini {
    width: 60px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 3px;
}

.neighbor-mini-screen {
    background: linear-gradient(180deg, #2d5a87 0%, #1e3a5f 100%);
    border-radius: 6px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6rem;
    position: relative;
    overflow: hidden;
}

.neighbor-mini-alert {
    position: absolute;
    inset: 0;
    background: var(--alert);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    animation: alertPulse 0.3s infinite;
    border-radius: 6px;
}

.neighbor-mini-alert.active {
    display: flex;
}

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

/* =====================
   Phone Mockup
   ===================== */
.phone-mockup {
    width: 320px;
    height: 640px;
    background: #1a1a1a;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 25px 50px -12px rgba(0,0,0,0.25),
        inset 0 0 0 2px #333;
    position: relative;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .phone-mockup {
        width: 100%;
        max-width: 360px;
        height: 600px;
    }
}

.phone-notch {
    width: 120px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.webchat-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.phone-home-bar {
    width: 100px;
    height: 4px;
    background: #666;
    border-radius: 2px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

/* =====================
   Demo Chat Simulado
   ===================== */
.demo-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f6f7f9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeInUp 0.3s ease-out;
}

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

.chat-message.bot {
    background: white;
    color: var(--gray-800);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.system {
    background: rgba(125, 161, 119, 0.15);
    color: var(--accent);
    align-self: center;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.chat-message.alert {
    background: rgba(220, 53, 69, 0.15);
    color: var(--alert);
    align-self: center;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    animation: pulseAlert 1s infinite;
}

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

.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
}

.quick-reply-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.quick-reply-btn.danger {
    border-color: var(--alert);
    color: var(--alert);
}

.quick-reply-btn.danger:hover {
    background: var(--alert);
    color: white;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
}

.chat-input-area input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}
