/* ============================================
   MODERN FEEDBACK CHAT WIDGET STYLES
   ============================================ */

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

/* Floating Chat Button */
.chat-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #555555 0%, #0d0d0d 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.chat-toggle:active {
    transform: scale(0.95);
}

.chat-toggle .chat-icon,
.chat-toggle .close-icon {
    transition: all 0.3s ease;
}

.chat-toggle .close-icon {
    display: none;
}

.chat-toggle.active .chat-icon {
    display: none;
}

.chat-toggle.active .close-icon {
    display: block;
}

/* Notification Badge */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

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

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

/* Chat Box Container */
.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-box.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-box.hidden {
    display: flex;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #555555 0%, #0d0d0d 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

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

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

/* Nickname Prompt */
.nickname-prompt {
    padding: 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.nickname-prompt label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #374151;
}

.nickname-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.nickname-prompt input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

.nickname-prompt button {
    padding: 10px 16px;
    background: #464646;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.nickname-prompt button:hover {
    background: #5568d3;
}

.nickname-skip {
    background: transparent !important;
    color: #6b7280 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.nickname-skip:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.nickname-prompt.hidden {
    display: none;
}

/* Messages Container */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
    scroll-behavior: smooth;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px 0;
}

.welcome-message p {
    background: #f3f4f6;
    display: inline-block;
    padding: 12px 20px;
    border-radius: 20px;
    color: #4b5563;
    font-size: 14px;
    margin: 0;
}

/* Message Bubble */
.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.client .message-content {
    background: linear-gradient(167deg, #000000 0%, #9f9f9f 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.admin .message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.admin .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 16px;
    margin: 0 20px 16px 20px;
    background: #f3f4f6;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 4px;
    width: fit-content;
}

.typing-indicator.hidden {
    display: none;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Form */
.chat-form {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-form textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

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

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2f2f2f 0%, #000000 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(133, 133, 133, 0.4);
}

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

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Footer */
.chat-footer {
    padding: 12px 20px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #feedback-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chat-toggle {
        width: 56px;
        height: 56px;
    }

    .chat-box {
        width: 100%;
        height: calc(100vh - 100px);
        bottom: 76px;
        right: 0;
        left: 0;
        margin: 0 auto;
    }
}