/* ===================================
   🌊 IBRATIN CHATBOT SIMULATOR
   Cores: Azul Oceano (#0066CC, #0052A3)
   Performance Optimized
   =================================== */

:root {
    --primary: #0066CC;
    --primary-dark: #0052A3;
    --primary-light: #3385DB;
    --secondary: #00A8E8;
    --accent: #FFB300;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FF9800;
    
    --bg-main: #F5F7FA;
    --bg-sidebar: #FFFFFF;
    --bg-chat: #FFFFFF;
    --bg-card: #FFFFFF;
    
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    --border: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Performance */
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
}

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

/* Performance optimization */
*,
*::before,
*::after {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   HEADER
   =================================== */

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 32px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.ai-badge {
    background: var(--accent);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.header-info {
    display: flex;
    gap: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
}

.info-item i {
    font-size: 18px;
}

.info-item span {
    font-weight: 700;
    font-size: 18px;
}

/* ===================================
   MAIN LAYOUT
   =================================== */

.main-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
    background: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.categories h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    text-align: left;
}

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

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.category-btn i {
    font-size: 16px;
    width: 20px;
}

.category-btn .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.category-btn.active .count {
    background: rgba(255,255,255,0.2);
}

/* ===================================
   CONTENT AREA
   =================================== */

.content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

/* ===================================
   SCENARIO LIST
   =================================== */

.scenario-list {
    background: transparent;
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 8px;
}

.scenario-list::-webkit-scrollbar {
    width: 6px;
}

.scenario-list::-webkit-scrollbar-track {
    background: transparent;
}

.scenario-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.scenario-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--primary);
}

.scenario-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.scenario-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0,102,204,0.05) 0%, rgba(0,82,163,0.05) 100%);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.scenario-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scenario-category.universal { background: #E3F2FD; color: #1976D2; }
.scenario-category.ecommerce { background: #E8F5E9; color: #388E3C; }
.scenario-category.pro { background: #FFF3E0; color: #F57C00; }
.scenario-category.b2b { background: #F3E5F5; color: #7B1FA2; }
.scenario-category.posvenda { background: #FCE4EC; color: #C2185B; }
.scenario-category.cor { background: #FFF9C4; color: #F57F17; }
.scenario-category.revenda { background: #E0F2F1; color: #00695C; }
.scenario-category.reclamacao { background: #FFEBEE; color: #D32F2F; }

.scenario-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.scenario-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scenario-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.scenario-meta i {
    margin-right: 4px;
}

/* ===================================
   CHAT SIMULATOR
   =================================== */

.chat-simulator {
    background: var(--bg-chat);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    overflow: hidden;
}

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

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.back-btn i {
    font-size: 18px;
}

.chat-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-title p {
    font-size: 13px;
    opacity: 0.9;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.control-btn.active {
    background: var(--accent);
    color: var(--primary-dark);
}

.control-btn.muted {
    opacity: 0.5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-main);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--primary);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    max-width: 400px;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: messageSlide 0.4s ease;
}

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

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px !important;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator-container {
    animation: messageSlide 0.3s ease;
}

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

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

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Emoticons otimizados */
.message-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

/* Ajuste de line-height para emoticons */
.message-content br {
    line-height: 1.8;
}

.message-time {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-top: 6px;
    text-align: right;
}

.message-receipt {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    color: #34B7F1;
}

.message.user .message-receipt {
    color: rgba(255,255,255,0.8);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin: 0 12px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: white;
    order: 2;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.8;
}

.chat-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--border);
    background: white;
}

.message-progress {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.message-progress span {
    color: var(--primary);
    font-weight: 700;
}

.navigation-buttons {
    display: flex;
    gap: 12px;
}

.nav-btn {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.nav-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===================================
   STATISTICS PANEL
   =================================== */

.stats-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    min-width: 250px;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.3s ease;
    z-index: 200;
}

.stats-panel.active {
    transform: translateX(0);
}

.stats-toggle {
    position: absolute;
    top: 50%;
    left: -48px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stats-toggle:hover {
    transform: translateY(-50%) translateX(-4px);
}

.stats-toggle i {
    font-size: 20px;
}

.stats-content h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.stat-item span {
    color: var(--text-secondary);
}

.stat-item strong {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

/* ===================================
   RESPONSIVE & MOBILE OPTIMIZED
   =================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hardware acceleration for animations */
.message,
.scenario-card,
.category-btn,
.nav-btn {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Desktop Large (1400px+) */
@media (min-width: 1400px) {
    .content {
        grid-template-columns: 450px 1fr;
    }
}

/* Desktop Medium (1200px - 1400px) */
@media (max-width: 1400px) {
    .main-container {
        grid-template-columns: 280px 1fr;
    }
    
    .content {
        grid-template-columns: 380px 1fr;
    }
}

/* Tablet Large (992px - 1200px) */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 260px 1fr;
    }
    
    .content {
        grid-template-columns: 1fr;
    }
    
    .scenario-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
        max-height: none;
        padding-right: 0;
    }
    
    .chat-simulator {
        height: 700px;
    }
}

/* Tablet (768px - 992px) */
@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sidebar {
        position: static;
        margin-bottom: 0;
        border-radius: var(--radius-lg);
    }
    
    .content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .scenario-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        max-height: 450px;
        overflow-y: auto;
        margin-bottom: 0;
    }
    
    .chat-simulator {
        height: 650px;
    }
}

/* ===================================
   MOBILE LARGE (576px - 768px)
   EXPERIÊNCIA MODERNA E ALINHADA
   =================================== */
@media (max-width: 768px) {
    /* Header otimizado */
    .header {
        padding: 16px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .header-info {
        display: none;
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 20px;
        font-weight: 700;
    }
    
    .logo i {
        font-size: 26px;
    }
    
    .ai-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    /* Container principal */
    .main-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    /* Sidebar mobile otimizada */
    .sidebar {
        padding: 20px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
    }
    
    .sidebar-header h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .search-box {
        margin-bottom: 20px;
    }
    
    .search-box input {
        font-size: 15px;
        padding: 14px 14px 14px 44px;
        border-radius: var(--radius-md);
    }
    
    .search-box i {
        left: 15px;
        font-size: 16px;
    }
    
    /* Categorias em grid moderno */
    .categories h4 {
        font-size: 13px;
        margin-bottom: 14px;
        font-weight: 700;
        letter-spacing: 0.8px;
    }
    
    .categories {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-btn {
        font-size: 13px;
        padding: 12px 14px;
        border-radius: var(--radius-md);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        min-height: 70px;
        justify-content: center;
    }
    
    .category-btn i {
        font-size: 20px;
        width: auto;
        margin-bottom: 4px;
    }
    
    .category-btn .count {
        font-size: 11px;
        padding: 3px 8px;
        margin-top: 4px;
    }
    
    /* Content area */
    .content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Lista de cenários otimizada */
    .scenario-list {
        grid-template-columns: 1fr;
        max-height: 500px;
        overflow-y: auto;
        padding-right: 8px;
    }
    
    .scenario-card {
        padding: 18px;
        border-radius: var(--radius-md);
        margin-bottom: 12px;
    }
    
    .scenario-header {
        margin-bottom: 10px;
    }
    
    .scenario-category {
        font-size: 10px;
        padding: 5px 12px;
        letter-spacing: 0.6px;
    }
    
    .scenario-title {
        font-size: 16px;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .scenario-preview {
        font-size: 13px;
        line-height: 1.5;
        -webkit-line-clamp: 3;
    }
    
    .scenario-meta {
        margin-top: 14px;
        padding-top: 14px;
        gap: 12px;
        font-size: 11px;
    }
    
    /* Chat Simulator mobile perfeito */
    .chat-simulator {
        height: calc(100vh - 180px);
        min-height: 500px;
        max-height: 650px;
        border-radius: var(--radius-lg);
    }
    
    .chat-header {
        padding: 16px 18px;
        flex-wrap: wrap;
    }
    
    .chat-header-left {
        flex: 1;
        min-width: 0;
    }
    
    .back-btn {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }
    
    .chat-title h3 {
        font-size: 16px;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .chat-title p {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .chat-controls {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .control-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    /* Mensagens mobile otimizadas */
    .chat-messages {
        padding: 16px;
        padding-bottom: 20px;
    }
    
    .message {
        margin-bottom: 16px;
    }
    
    .message-avatar {
        width: 34px;
        height: 34px;
        font-size: 16px;
        margin: 0 10px;
    }
    
    .message-content {
        max-width: 80%;
        font-size: 14px;
        padding: 14px 16px;
        border-radius: var(--radius-md);
        line-height: 1.7;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .message.user .message-content {
        border-bottom-right-radius: 6px;
    }
    
    .message.bot .message-content {
        border-bottom-left-radius: 6px;
    }
    
    /* Footer mobile */
    .chat-footer {
        padding: 16px 18px;
        background: white;
        border-top: 2px solid var(--border);
    }
    
    .message-progress {
        font-size: 12px;
        margin-bottom: 14px;
        font-weight: 600;
    }
    
    .navigation-buttons {
        display: flex;
        gap: 10px;
    }
    
    .nav-btn {
        flex: 1;
        padding: 14px 20px;
        font-size: 14px;
        font-weight: 600;
        border-radius: var(--radius-md);
        min-height: 48px;
    }
    
    .nav-btn i {
        font-size: 14px;
    }
    
    /* Stats panel mobile */
    .stats-panel {
        bottom: 20px;
        right: 16px;
        min-width: 220px;
        border-radius: var(--radius-md);
    }
    
    .stats-toggle {
        left: -46px;
        width: 46px;
        height: 46px;
    }
    
    /* Empty state mobile */
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state i {
        font-size: 56px;
        margin-bottom: 16px;
    }
    
    .empty-state h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
}

/* ===================================
   MOBILE MEDIUM (420px - 576px)
   EXPERIÊNCIA REFINADA
   =================================== */
@media (max-width: 576px) {
    .header {
        padding: 14px 0;
    }
    
    .header-content {
        padding: 0 12px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .ai-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .main-container {
        padding: 12px;
        gap: 12px;
    }
    
    .sidebar {
        padding: 16px;
    }
    
    .sidebar-header h3 {
        font-size: 17px;
    }
    
    .search-box input {
        font-size: 14px;
        padding: 12px 12px 12px 40px;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .category-btn {
        font-size: 14px;
        padding: 14px;
        min-height: 56px;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .category-btn i {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    .scenario-list {
        max-height: 450px;
    }
    
    .scenario-card {
        padding: 16px;
    }
    
    .scenario-title {
        font-size: 15px;
    }
    
    .scenario-preview {
        font-size: 12px;
    }
    
    .chat-simulator {
        height: calc(100vh - 160px);
        min-height: 480px;
        max-height: 600px;
    }
    
    .chat-header {
        padding: 14px 16px;
    }
    
    .chat-title h3 {
        font-size: 15px;
    }
    
    .chat-title p {
        font-size: 11px;
    }
    
    .back-btn, .control-btn {
        width: 36px;
        height: 36px;
    }
    
    .chat-messages {
        padding: 14px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 15px;
        margin: 0 8px;
    }
    
    .message-content {
        font-size: 13px;
        padding: 12px 14px;
        max-width: 82%;
    }
    
    .chat-footer {
        padding: 14px 16px;
    }
    
    .nav-btn {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* ===================================
   MOBILE SMALL (< 420px)
   EXPERIÊNCIA COMPACTA
   =================================== */
@media (max-width: 420px) {
    .header {
        padding: 12px 0;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .logo {
        gap: 8px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .logo i {
        font-size: 22px;
    }
    
    .main-container {
        padding: 10px;
        gap: 10px;
    }
    
    .sidebar {
        padding: 14px;
        border-radius: var(--radius-md);
    }
    
    .search-box input {
        padding: 11px 11px 11px 38px;
    }
    
    .category-btn {
        padding: 12px;
        min-height: 52px;
        font-size: 13px;
    }
    
    .scenario-list {
        max-height: 400px;
    }
    
    .scenario-card {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .scenario-title {
        font-size: 14px;
    }
    
    .scenario-preview {
        font-size: 11px;
    }
    
    .chat-simulator {
        height: calc(100vh - 140px);
        min-height: 450px;
        max-height: 550px;
        border-radius: var(--radius-md);
    }
    
    .chat-header {
        padding: 12px 14px;
    }
    
    .back-btn, .control-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    
    .chat-title h3 {
        font-size: 14px;
    }
    
    .chat-title p {
        font-size: 10px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message {
        margin-bottom: 14px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
        margin: 0 6px;
    }
    
    .message-content {
        font-size: 12px;
        padding: 11px 13px;
        max-width: 85%;
    }
    
    .chat-footer {
        padding: 12px 14px;
    }
    
    .message-progress {
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .navigation-buttons {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 11px 14px;
        font-size: 12px;
        min-height: 42px;
    }
    
    .stats-panel {
        min-width: 200px;
        padding: 16px;
        bottom: 16px;
        right: 12px;
    }
}

/* ===================================
   TOUCH DEVICES OPTIMIZATION
   =================================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .scenario-card,
    .category-btn,
    .nav-btn,
    .control-btn,
    .back-btn {
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
    }
    
    /* Increase touch targets */
    .category-btn,
    .control-btn,
    .back-btn,
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    .scenario-card:hover,
    .category-btn:hover,
    .nav-btn:hover {
        transform: none;
    }
    
    /* Active states for touch feedback */
    .scenario-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .category-btn:active,
    .nav-btn:active,
    .control-btn:active {
        transform: scale(0.95);
        opacity: 0.9;
    }
    
    /* Better scrolling on iOS */
    .scenario-list,
    .chat-messages {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent text selection on buttons */
    .category-btn,
    .nav-btn,
    .control-btn,
    .back-btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

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