/* ─── Floating Chat Button ─── */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none; /* Allow clicks to pass through to elements behind */
}

body.session-running .chat-widget-container {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 205, 48, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
    overflow: hidden;
    pointer-events: all; /* Re-enable clicks for the button */
}

.chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(255, 205, 48, 0.6);
}

.chat-trigger i svg {
    width: 28px;
    height: 28px;
    color: #000;
}

/* ─── Feedback Form (Widget) ─── */
.feedback-window {
    width: 350px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    margin-bottom: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.feedback-window.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all; /* Re-enable clicks when shown */
}

.feedback-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feedback-header .avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.header-text h3 {
    font-size: 16px;
    margin: 0;
    color: #fff;
    font-weight: 800;
}

.header-text p {
    font-size: 11px;
    margin: 2px 0 0;
    color: var(--text-dim);
}

.close-window-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-right: -5px;
}

.close-window-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.close-window-btn svg {
    display: block;
}

.feedback-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    font-weight: 700;
}

/* Custom Select Styles */
.custom-select-wrapper {
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.custom-select-trigger.selected {
    color: #fff;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 205, 48, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 205, 48, 0.2);
}

.custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #1a1a2e;
    border: 1px solid rgba(255, 205, 48, 0.3);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.custom-option {
    padding: 12px 15px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    display: block;
}

.custom-option:hover {
    background: rgba(255, 205, 48, 0.15);
    color: var(--accent);
    padding-left: 20px;
}

.feedback-input, .feedback-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.feedback-select:focus, .feedback-input:focus, .feedback-textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.feedback-textarea {
    height: 100px;
    resize: none;
}

.feedback-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    text-transform: uppercase;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 205, 48, 0.3);
}

.feedback-btn:active {
    transform: translateY(0);
}

/* Success & Error States */
.success-msg,
.error-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    height: 100%;
}

.success-msg.show,
.error-msg.show {
    display: flex;
    animation: msgFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.success-msg .icon,
.error-msg .icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.error-msg .icon {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.success-msg h3,
.error-msg h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 800;
}

/* ─── Mobile Support: Plate Trigger (≤ 1024px) ─── */
@media (max-width: 1024px) {
  .chat-widget-container {
    bottom: 150px !important;
    right: 0 !important;
    align-items: flex-end !important;
  }

  .chat-trigger {
    width: 40px !important;
    height: auto !important;
    min-height: 130px !important;
    border-radius: 12px 0 0 12px !important;
    padding: 16px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-shadow: -4px 4px 16px rgba(255, 205, 48, 0.25) !important;
  }

  .chat-trigger:hover {
    transform: translateX(-4px) !important;
    box-shadow: -6px 6px 20px rgba(255, 205, 48, 0.35) !important;
  }

  .chat-trigger .trigger-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: rotate(-90deg); /* Rotated to point the tail to the right side of the screen */
    transition: transform 0.3s ease !important;
  }

  .chat-trigger .trigger-label {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #000 !important;
    letter-spacing: 1px !important;
    font-family: inherit !important;
    writing-mode: vertical-rl !important;
    transform: rotate(180deg) !important;
    white-space: nowrap !important;
  }

  .chat-trigger i svg,
  .chat-trigger .trigger-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .feedback-window {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: calc(100vw - 40px) !important;
    max-width: 350px !important;
    border-radius: 20px !important;
    transform-origin: bottom right !important;
    z-index: 10000 !important;
  }
}

/* Hide label on desktop */
@media (min-width: 1025px) {
  .chat-trigger .trigger-label {
    display: none !important;
  }
}

