/* Chat Widget Styles - Themed for Suntech Solar */
:root {
          --chat-primary: #0F172A;
          /* Deep Navy - Site Primary */
          --chat-accent: #F59E0B;
          /* Solar Gold - Site Secondary */
          --chat-bg: #ffffff;
          --chat-text: #334155;
          --chat-light: #F8FAFC;
}

#chat-widget-container {
          position: fixed;
          bottom: 2rem;
          right: 2rem;
          z-index: 9999;
          font-family: 'Inter', sans-serif;
}

/* Toggle Button */
#chat-toggle-btn {
          width: 65px;
          height: 65px;
          background: var(--chat-primary);
          background: linear-gradient(135deg, var(--chat-primary), #1e293b);
          border-radius: 50%;
          border: 2px solid var(--chat-accent);
          box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
          position: relative;
          overflow: hidden;
}

#chat-toggle-btn:hover {
          transform: scale(1.1);
          box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
          /* Gold glow on hover */
}

#chat-toggle-btn::after {
          content: '';
          position: absolute;
          top: -50%;
          left: -50%;
          width: 200%;
          height: 200%;
          background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
          opacity: 0;
          transform: scale(0.5);
          transition: opacity 0.3s, transform 0.3s;
}

#chat-toggle-btn:hover::after {
          opacity: 1;
          transform: scale(1);
}

#chat-toggle-btn i {
          color: var(--chat-light);
          font-size: 26px;
          transition: all 0.3s ease;
          z-index: 2;
}

#chat-toggle-btn .close-icon {
          display: none;
          color: var(--chat-accent);
          /* Gold X when open */
}

#chat-toggle-btn.open {
          transform: rotate(90deg);
          background: var(--chat-primary);
}

#chat-toggle-btn.open .message-icon {
          display: none;
}

#chat-toggle-btn.open .close-icon {
          display: block;
          transform: rotate(-90deg);
          /* Counter-rotate icon to stay upright if desired, or let it spin */
}

/* Chat Box */
.chat-box {
          position: absolute;
          bottom: 85px;
          right: 0;
          width: 380px;
          /* Slightly wider */
          height: 600px;
          /* Taller */
          max-height: 80vh;
          background: rgba(255, 255, 255, 0.98);
          /* Slight transparency */
          backdrop-filter: blur(10px);
          border-radius: 20px;
          box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
          display: flex;
          flex-direction: column;
          overflow: hidden;
          opacity: 0;
          transform: translateY(20px) scale(0.95);
          pointer-events: none;
          transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
          border: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-box.open {
          opacity: 1;
          transform: translateY(0) scale(1);
          pointer-events: all;
}

/* Chat Header */
.chat-header {
          background: linear-gradient(135deg, var(--chat-primary), #1e293b);
          padding: 1.2rem;
          color: white;
          display: flex;
          justify-content: space-between;
          align-items: center;
          border-bottom: 2px solid var(--chat-accent);
}

.chat-header h3 {
          margin: 0;
          font-family: 'Outfit', sans-serif;
          /* Matching headings font */
          font-size: 1.2rem;
          display: flex;
          align-items: center;
          gap: 10px;
          font-weight: 600;
}

.end-chat-btn {
          background: rgba(245, 158, 11, 0.2);
          /* Gold tint */
          border: 1px solid var(--chat-accent);
          color: var(--chat-accent);
          padding: 6px 14px;
          border-radius: 20px;
          font-size: 0.8rem;
          font-family: 'Outfit', sans-serif;
          cursor: pointer;
          transition: all 0.2s;
          font-weight: 500;
}

.end-chat-btn:hover {
          background: var(--chat-accent);
          color: var(--chat-primary);
}

/* Chat Messages */
.chat-messages {
          flex: 1;
          padding: 1.2rem;
          overflow-y: auto;
          display: flex;
          flex-direction: column;
          gap: 16px;
          background-color: var(--chat-bg);
}

.message {
          max-width: 85%;
          padding: 12px 16px;
          border-radius: 12px;
          font-size: 0.95rem;
          line-height: 1.5;
          position: relative;
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.bot {
          background: #F1F5F9;
          color: var(--chat-text);
          align-self: flex-start;
          border-bottom-left-radius: 2px;
          border-left: 3px solid var(--chat-accent);
          /* Gold strip for bot */
}

.message.user {
          background: var(--chat-primary);
          color: white;
          align-self: flex-end;
          border-bottom-right-radius: 2px;
          background: linear-gradient(135deg, var(--chat-primary), #2d3748);
}

.typing-indicator {
          font-size: 0.8rem;
          color: #94A3B8;
          margin-left: 15px;
          display: none;
          font-style: italic;
          margin-bottom: 5px;
}

.typing-indicator.visible {
          display: block;
}

/* Chat Input */
.chat-input-area {
          padding: 1.2rem;
          background: var(--chat-light);
          border-top: 1px solid #E2E8F0;
          display: flex;
          gap: 12px;
}

.chat-input-area input {
          flex: 1;
          padding: 12px 18px;
          border: 2px solid #E2E8F0;
          border-radius: 25px;
          outline: none;
          font-family: inherit;
          transition: border-color 0.2s;
}

.chat-input-area input:focus {
          border-color: var(--chat-accent);
}

.send-btn {
          background: var(--chat-accent);
          /* Solar Gold Button */
          color: var(--chat-primary);
          border: none;
          width: 45px;
          height: 45px;
          border-radius: 50%;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 1.1rem;
          transition: all 0.2s;
          box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.send-btn:hover {
          transform: scale(1.05);
          background: #e69200;
}

@media (max-width: 480px) {
          .chat-box {
                    width: 100%;
                    height: 100%;
                    bottom: 0;
                    right: 0;
                    border-radius: 0;
                    max-height: 100vh;
          }

          #chat-widget-container {
                    bottom: 0;
                    right: 0;
                    left: 0;
          }

          #chat-toggle-btn {
                    position: absolute;
                    bottom: 2rem;
                    right: 2rem;
          }
}