/* Cores base:
   - fundo geral:      #101010
   - fundo painel:     #232323
   - texto principal:  #F5F5F5
   - cor destaque:     #FFBB00
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    background-color: #0D1117;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #E6EDF3;
    height: 100vh;
    overflow: hidden;
  }
  
  /* Container principal */
  .chat-container {
    display: flex;
    height: 100vh;
    background-color: #0D1117;
  }
  
  .sidebar {
    width: 260px;
    background-color: #161B22;
    border-right: 1px solid #21262D;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
  }
  
  .sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #21262D;
  }
  
  .new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: transparent;
    border: 1px solid #30363D;
    border-radius: 8px;
    color: #E6EDF3;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
  }
  
  .new-chat-btn:hover {
    background-color: #21262D;
    border-color: #40464D;
  }
  
  .sidebar-content {
    flex: 1;
    padding: 16px 8px;
    overflow-y: auto;
  }
  
  .chat-history-item {
    padding: 12px 16px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #8B949E;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .chat-history-item:hover {
    background-color: #21262D;
    color: #E6EDF3;
  }
  
  .chat-history-item.active {
    background-color: #21262D;
    color: #E6EDF3;
  }
  
  .main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - 260px);
    position: relative;
  }
  
  .chat-logo {
    position: absolute;
    top: 35dvh;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 250px;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.02;
    z-index: 1;
    pointer-events: none;
  }
  
  .chat-header {
    background-color: #161B22;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #21262D;
    min-height: 64px;
  }
  
  .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #8B949E;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
  }
  
  .sidebar-toggle:hover {
    background-color: #21262D;
    color: #E6EDF3;
  }
  
  .header-title {
    font-size: 16px;
    font-weight: 600;
    color: #E6EDF3;
  }
  
  .chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    background-color: #0D1117;
  }
  
  .messages-container {
    width: 100%;
    max-width: 768px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    scroll-behavior: smooth;
  }
  
  .messages-container::-webkit-scrollbar {
    width: 8px;
  }
  
  .messages-container::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .messages-container::-webkit-scrollbar-thumb {
    background-color: #30363D;
    border-radius: 4px;
  }
  
  .messages-container::-webkit-scrollbar-thumb:hover {
    background-color: #40464D;
  }
  
  .chat-screen {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .message {
    display: flex;
    gap: 16px;
    animation: fadeIn 0.3s ease;
  }
  
  .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .message.bot .message-avatar {
    background-image: url('c3b.png');
  }
  
  .message.user .message-avatar {
    background-image: url('user.png');
  }
  
  .message-content {
    flex: 1;
    color: #E6EDF3;
    font-size: 16px;
    line-height: 1.6;
    padding-top: 4px;
  }
  
  .message.bot .message-content {
    margin-left: 0;
  }
  
  .message.user .message-content {
    margin-right: 0;
  }
  
  .chat-footer {
    background-color: #0D1117;
    padding: 24px;
    border-top: 1px solid #21262D;
    display: flex;
    justify-content: center;
  }
  
  .input-container {
    width: 100%;
    max-width: 100%;
    position: relative;
  }
  
  .input-wrapper {
    display: flex;
    align-items: end;
    background-color: #161B22;
    border: 1px solid #30363D;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s ease;
  }
  
  .input-wrapper:focus-within {
    border-color: #40464D;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
  }
  
  .chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #E6EDF3;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
    min-height: 24px;
    font-family: inherit;
  }
  
  .chat-input::placeholder {
    color: #6E7681;
  }
  
  .attach-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6E7681;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 8px;
  }
  
  .attach-btn:hover {
    background-color: #21262D;
    color: #FFBB00;
  }
  
  .send-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6E7681;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 8px;
  }
  
  .send-btn:hover:not(:disabled) {
    background-color: #21262D;
    color: #E6EDF3;
  }
  
  .send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  
  .image-preview {
    background-color: #21262D;
    border: 1px solid #30363D;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px;
  }
  
  .preview-content {
    position: relative;
    display: inline-block;
  }
  
  .preview-content img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    display: block;
  }
  
  .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #DA3633;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
  }
  
  .remove-image:hover {
    background-color: #C42525;
  }
  
  .message-image {
    margin-bottom: 8px;
  }
  
  .message-image img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
  }
  
  .message-image img:hover {
    opacity: 0.9;
    transform: scale(1.02);
  }
  
  .message-text {
    margin-top: 4px;
  }
  
  .image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
  }
  
  .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
  }
  
  .modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
  }
  
  .modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s ease;
  }
  
  .modal-close:hover {
    opacity: 0.7;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .header-right {
    display: flex;
    align-items: center;
  }
  
  .connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
  }
  
  .connection-status.connected {
    background-color: rgba(16, 163, 127, 0.1);
    color: #10A37F;
  }
  
  .connection-status.disconnected {
    background-color: rgba(248, 81, 73, 0.1);
    color: #F85149;
  }
  
  .connection-status .material-icons {
    font-size: 14px;
  }
  
  .queue-status {
    padding: 16px;
    background-color: #21262D;
    border-radius: 8px;
    margin: 8px;
  }
  
  .status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: #8B949E;
  }
  
  .status-item .material-icons {
    font-size: 16px;
    color: #FFBB00;
  }
  
  .status-item strong {
    color: #E6EDF3;
  }
  
  .chat-timer-widget {
    margin: 16px 8px;
    padding: 16px;
    background-color: #21262D;
    border-radius: 8px;
    border: 1px solid #30363D;
  }
  
  .timer-icon {
    text-align: center;
    margin-bottom: 12px;
  }
  
  .timer-icon .material-icons {
    font-size: 24px;
    color: #FFBB00;
  }
  
  .timer-info {
    text-align: center;
    margin-bottom: 12px;
  }
  
  .timer-label {
    font-size: 12px;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  
  .timer-display {
    font-size: 24px;
    font-weight: 700;
    color: #E6EDF3;
    font-family: monospace;
  }
  
  .timer-progress {
    width: 100%;
  }
  
  .timer-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #30363D;
    border-radius: 3px;
    overflow: hidden;
  }
  
  .timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10A37F, #FFBB00);
    transition: width 0.3s ease;
    width: 0%;
  }
  
  .welcome-screen, .queue-screen, .chat-ended-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
  }
  
  .admin-offline-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
  }
  
  .welcome-content, .queue-content, .ended-content {
    max-width: 500px;
    width: 100%;
  }
  
  .offline-content {
    max-width: 500px;
    width: 100%;
  }
  
  .welcome-icon, .queue-icon, .ended-icon {
    font-size: 80px !important;
    color: #FFBB00;
    margin-bottom: 24px;
    opacity: 0.8;
  }
  
  .offline-icon {
    font-size: 80px !important;
    color: #F85149;
    margin-bottom: 24px;
    opacity: 0.8;
  }
  
  .welcome-screen h2, .queue-screen h2, .chat-ended-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: #E6EDF3;
    margin-bottom: 16px;
  }
  
  .admin-offline-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: #E6EDF3;
    margin-bottom: 16px;
  }
  
  .welcome-screen p, .queue-screen p, .chat-ended-screen p {
    font-size: 16px;
    color: #8B949E;
    line-height: 1.6;
    margin-bottom: 12px;
  }
  
  .admin-offline-screen p {
    font-size: 16px;
    color: #8B949E;
    line-height: 1.6;
    margin-bottom: 12px;
  }
  
  .cta-button {
    background: linear-gradient(135deg, #FFBB00, #ff8c00);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  }
  
  .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
  }
  
  .cta-button:active {
    transform: translateY(0);
  }
  
  .queue-info {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-top: 32px;
  }
  
  .queue-stat {
    text-align: center;
    padding: 20px;
    background-color: #161B22;
    border-radius: 12px;
    border: 1px solid #21262D;
    min-width: 120px;
  }
  
  .queue-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #FFBB00;
    font-family: monospace;
    margin-bottom: 8px;
  }
  
  .queue-label {
    font-size: 12px;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .sound-btn {
    background-color: #21262D;
    border: 1px solid #30363D;
    border-radius: 12px;
    color: #8B949E;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px auto 0;
    transition: all 0.3s ease;
    max-width: 280px;
  }
  
  .sound-btn:hover {
    background-color: #30363D;
    border-color: #40464D;
    color: #E6EDF3;
  }
  
  .sound-btn.sound-enabled {
    background-color: rgba(16, 163, 127, 0.1);
    border-color: #10A37F;
    color: #10A37F;
  }
  
  .sound-btn.sound-enabled:hover {
    background-color: rgba(16, 163, 127, 0.2);
    color: #E6EDF3;
  }
  
  .sound-btn .material-icons {
    font-size: 18px;
  }
  
  .system-message {
    text-align: center;
    font-style: italic;
    color: #8B949E !important;
    background-color: #21262D;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 14px;
    margin: 12px auto;
    max-width: 80%;
  }
  
  @media (max-width: 768px) {
    .sidebar {
      position: fixed;
      left: 0;
      top: 0;
      height: 100vh;
      z-index: 1000;
      transform: translateX(-100%);
    }
    
    .sidebar.open {
      transform: translateX(0);
    }
    
    .main-chat {
      max-width: 100vw;
    }
    
    .chat-logo {
      width: 80px;
      height: 80px;
      top: 60px;
    }
    
    .sidebar-toggle {
      display: block !important;
    }
    
    .messages-container {
      padding: 16px;
      max-width: 100%;
      max-height: calc(100vh - 180px);
    }
    
    .chat-footer {
      padding: 16px;
    }
    
    .input-container {
      max-width: 100%;
    }
    
    .message {
      gap: 12px;
    }
    
    .message-avatar {
      width: 28px;
      height: 28px;
      font-size: 14px;
    }
    
    .message-content {
      font-size: 15px;
    }

    .header-right {
      display: none;
    }

    .welcome-icon, .queue-icon, .ended-icon {
      font-size: 64px !important;
    }

    .offline-icon {
      font-size: 64px !important;
    }

    .welcome-screen h2, .queue-screen h2, .chat-ended-screen h2 {
      font-size: 24px;
    }

    .admin-offline-screen h2 {
      font-size: 24px;
    }

    .queue-info {
      flex-direction: column;
      gap: 16px;
      align-items: center;
    }

    .queue-stat {
      min-width: 100px;
      padding: 16px;
    }

    .queue-number {
      font-size: 28px;
    }

    .chat-timer-widget {
      margin: 12px 8px;
      padding: 12px;
    }

    .timer-display {
      font-size: 20px;
    }

    .message-image img {
      max-width: 250px;
      max-height: 180px;
    }

    .preview-content img {
      max-width: 150px;
      max-height: 120px;
    }

    .sound-btn {
      padding: 10px 16px;
      font-size: 13px;
      max-width: 260px;
    }
  }
  
  @media (max-width: 480px) {
    .messages-container {
      padding: 12px;
      gap: 20px;
      max-height: calc(100vh - 160px);
    }
    
    .chat-footer {
      padding: 12px;
    }
    
    .input-wrapper {
      padding: 10px 12px;
    }
    
    .chat-input {
      font-size: 16px;
    }
    
    .chat-logo {
      width: 60px;
      height: 60px;
      top: 50px;
    }

    .welcome-screen, .queue-screen, .chat-ended-screen {
      padding: 16px;
    }

    .admin-offline-screen {
      padding: 16px;
    }

    .cta-button {
      padding: 14px 24px;
      font-size: 15px;
    }

    .status-item {
      font-size: 12px;
    }

    .message-image img {
      max-width: 200px;
      max-height: 150px;
    }

    .preview-content img {
      max-width: 120px;
      max-height: 100px;
    }

    .attach-btn {
      margin-right: 4px;
    }

    .sound-btn {
      padding: 8px 12px;
      font-size: 12px;
      max-width: 240px;
    }
  }