.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.chat-bubble.open {
    transform: scale(0.9);
}

.chat-bubble-icon {
    font-size: 28px;
    transition: transform 0.3s;
}

.chat-bubble.open .chat-bubble-icon {
    transform: rotate(90deg);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.chat-badge.show {
    display: flex;
}

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

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.open {
    display: flex;
}

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

@media (max-width: 480px) {
    .chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        z-index: 10000;
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-text p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
    line-height: 1.5;
}

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

.message.bot {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.visitor {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.admin {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    position: relative;
    padding-left: 40px;
}

.message.admin::before {
    content: "👤";
    position: absolute;
    left: 12px;
    top: 12px;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-width: 75%;
}

.chat-button {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-button:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    align-self: flex-start;
    max-width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    margin: 0 2px;
    animation: bounce 1.4s infinite;
}

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

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

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

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-input::placeholder {
    color: #9ca3af;
}

.send-button {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.waiting-message {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    padding: 8px;
    font-style: italic;
}

.welcome-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 280px;
    display: none;
    animation: slideUp 0.5s ease;
}

.welcome-popup.show {
    display: block;
}

.welcome-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
}

.welcome-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
}

.welcome-popup h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #1f2937;
}

.welcome-popup p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.tabs {
    border: 4px solid #000;
    background: #fff;
  }
  
  .tabs-nav {
    display: flex;
    border-bottom: 4px solid #000;
  }
  
  .tab-link {
    flex: 1;
    padding: 12px 16px;
    background: #eee;
    border: 0;
    border-right: 4px solid #000;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
  }
  
  .tab-link:last-child {
    border-right: 0;
  }
  
  .tab-link.active {
    background: #000;
    color: #fff;
  }
  
  .tab-panel {
    display: none;
    padding: 20px;
  }
  
  .tab-panel.active {
    display: block;
  }
  
/* === LAYOUT === */
.content-wrapper {
  display: flex;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  padding-right: 460px;
}

.main-content {
  flex: 1;
  max-width: 100%;
}

/* === TABS === */
.tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 4px solid #000;
}

.tab-link {
  padding: 12px 24px;
  background: #fff;
  border: 4px solid #000;
  border-bottom: none;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.tab-link:hover {
  background: #ffff00;
}

.tab-link.active {
  background: #000;
  color: #fff;
  box-shadow: 4px -4px 0 #ff0066;
}

.tab-panel {
  display: none;
  padding: 20px;
  border: 4px solid #000;
  background: #fff;
  box-shadow: 8px 8px 0 #00d9ff;
}

.tab-panel.active {
  display: block;
  animation: tabSlideIn 0.3s ease;
}

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

/* === CHAT WIDGET === */
#chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 420px;
  height: 600px;
  background: #fff;
  border: 8px solid #000;
  box-shadow: 12px 12px 0 #ff0066, 24px 24px 0 #000;
  font-family: 'Courier New', monospace;
  z-index: 9999;
  animation: glitchIn 0.3s ease-out;
}

@keyframes glitchIn {
  0% { transform: translate(-20px, 20px); opacity: 0; }
  20% { transform: translate(10px, -10px); }
  40% { transform: translate(-5px, 5px); }
  100% { transform: translate(0, 0); opacity: 1; }
}

#chat-header {
  background: #000;
  padding: 24px;
  color: #fff;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 8px solid #ff0066;
  position: relative;
}

#chat-header::before {
  content: '◢◤';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  color: #00d9ff;
  animation: rotate 4s linear infinite;
}

@keyframes rotate {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Close button - hidden op desktop */
#chat-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ff0066;
  border: 4px solid #000;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  z-index: 10;
  line-height: 1;
  padding: 0;
}

#chat-close:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

#chat-messages {
  height: calc(100% - 160px);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
}

#chat-messages::-webkit-scrollbar {
  width: 12px;
  background: #000;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #ff0066;
  border: 3px solid #000;
}

.msg {
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 75%;
  position: relative;
  font-weight: 700;
  animation: slideIn 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  word-wrap: break-word;
  letter-spacing: 0.5px;
}

@keyframes slideIn {
  0% { opacity: 0; transform: translateX(-30px) rotate(-2deg); }
  100% { opacity: 1; transform: translateX(0) rotate(0); }
}

.msg.visitor {
  align-self: flex-start;
  background: #fff;
  color: #000;
  border: 6px solid #000;
  box-shadow: 6px 6px 0 #00d9ff;
  transform: rotate(-1deg);
}

.msg.visitor::after {
  content: '→';
  position: absolute;
  right: -32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: #00d9ff;
  font-weight: 900;
}

.msg.owner {
  align-self: flex-end;
  background: #000;
  color: #fff;
  border: 6px solid #000;
  box-shadow: -6px 6px 0 #ff0066;
  transform: rotate(1deg);
}

.msg.owner::before {
  content: '←';
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: #ff0066;
  font-weight: 900;
}

#chat-input {
  padding: 20px;
  background: #fff;
  border-top: 8px solid #000;
}

#chat-form {
  display: flex;
  gap: 12px;
}

#chat-text {
  flex: 1;
  padding: 16px;
  background: #fff;
  border: 6px solid #000;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  outline: none;
  letter-spacing: 0.5px;
}

#chat-text:focus {
  background: #ffff00;
  box-shadow: 0 0 0 4px #00d9ff;
  transform: translateY(-2px);
}

#chat-text::placeholder {
  color: #999;
  font-weight: 700;
}

#chat-send {
  padding: 16px 28px;
  background: #ff0066;
  border: 6px solid #000;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  box-shadow: 6px 6px 0 #000;
  transition: all 0.1s ease;
}

#chat-send:hover {
  background: #00d9ff;
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
}

#chat-send:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.typing {
  align-self: flex-start;
  padding: 16px 20px;
  background: #000;
  border: 6px solid #000;
  box-shadow: 6px 6px 0 #00d9ff;
  display: flex;
  gap: 8px;
  transform: rotate(-1deg);
}

.typing span {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 3px solid #ff0066;
  animation: brutalbounce 1s infinite ease-in-out;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes brutalbounce {
  0%, 80%, 100% { transform: scale(0.8) rotate(0deg); }
  40% { transform: scale(1.2) rotate(45deg); }
}

/* === FLOATING BUTTON (mobiel) === */
#chat-toggle {
  display: none; /* Hidden op desktop */
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 70px;
  background: #ff0066;
  border: 6px solid #000;
  border-radius: 50%;
  box-shadow: 8px 8px 0 #000;
  cursor: pointer;
  z-index: 9998;
  font-size: 32px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#chat-toggle:active {
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0 #000;
}

#chat-toggle.has-notification::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: #00d9ff;
  border: 3px solid #000;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .content-wrapper {
    padding-right: 20px;
  }
  
  #chat-widget {
    right: 50%;
    transform: translateX(50%);
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 20px;
  }
  
  .tab-link {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  /* Chat hidden by default op mobiel */
  #chat-widget {
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    box-shadow: 0 -8px 0 #ff0066, 0 -16px 0 #000;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: none;
  }
  
  #chat-widget.open {
    bottom: 0;
  }
  
  /* Floating button visible op mobiel */
  #chat-toggle {
    display: flex;
  }
  
  /* Close button visible op mobiel */
  #chat-widget.open #chat-close {
    display: block;
  }
  
  #chat-header {
    font-size: 22px;
    padding: 20px;
    padding-right: 70px;
  }
  
  #chat-header::before {
    right: 70px;
    font-size: 24px;
  }
  
  .msg {
    font-size: 15px;
    max-width: 85%;
  }
  
  .msg.visitor::after,
  .msg.owner::before {
    display: none;
  }
}
