/* Secure Smart Chatbot - WordPress Compatible Styles */
/* Smart Charged Branding Colors */
:root {
    --ssc-yellow: #fefb3e;
    --ssc-green: #198754;
    --ssc-dark: #23272e;
    --ssc-gray: #f7fafc;
    --ssc-radius: 12px;
}

/* Chat Button */
.ssc-chat-button {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ssc-green);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.ssc-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4);
    background: #157347;
}

.ssc-chat-button--open {
    display: none;
}

/* Chat Container */
.ssc-chat-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 48px);
    z-index: 9999;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.ssc-chat-container--open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.ssc-chat-container--closing {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

/* Chat Window */
.ssc-chat-window {
    background: white;
    border-radius: var(--ssc-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Chat Header */
.ssc-chat-header {
    background: var(--ssc-dark);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.ssc-chat-title small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #a0aec0;
    margin-top: 2px;
}

.ssc-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ssc-new-chat-button,
.ssc-close-button {
    background: rgba(255, 255, 255, 0.1);
    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 ease;
}

.ssc-new-chat-button:hover,
.ssc-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.ssc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f7fafc;
}

/* Welcome Section */
.ssc-welcome {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 8px;
}

.ssc-welcome-text {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    padding: 0 8px;
}

/* Preset Questions */
.ssc-preset-questions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ssc-preset-question {
    background: var(--ssc-yellow);
    color: var(--ssc-dark);
    border: none;
    padding: 12px 20px;
    border-radius: var(--ssc-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ssc-preset-question:hover {
    background: #fef920;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ssc-preset-question:active {
    transform: translateY(0);
}

/* Message */
.ssc-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

.ssc-message--user {
    align-self: flex-end;
    align-items: flex-end;
}

.ssc-message--bot {
    align-self: flex-start;
    align-items: flex-start;
}

.ssc-message-content {
    padding: 12px 16px;
    border-radius: var(--ssc-radius);
    word-wrap: break-word;
    line-height: 1.5;
}

.ssc-message--user .ssc-message-content {
    background: var(--ssc-green);
    color: white;
    border-bottom-right-radius: 4px;
}

.ssc-message--bot .ssc-message-content {
    background: white;
    color: var(--ssc-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--ssc-yellow);
}

/* Links in messages */
.ssc-link {
    color: var(--ssc-green);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ssc-link:hover {
    color: #157347;
    text-decoration: underline;
}

.ssc-message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.ssc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.ssc-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ssc-green);
    animation: typing 1.4s infinite;
    opacity: 0.6;
}

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

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

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

/* Input Form */
.ssc-input-form {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.ssc-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--ssc-radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #f7fafc;
}

.ssc-input:focus {
    border-color: var(--ssc-yellow);
    box-shadow: 0 0 0 3px rgba(254, 251, 62, 0.1);
    background: white;
}

.ssc-input:disabled {
    background: #f7fafc;
    cursor: not-allowed;
}

.ssc-send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--ssc-yellow);
    color: var(--ssc-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(254, 251, 62, 0.3);
}

.ssc-send-button:hover:not(:disabled) {
    transform: scale(1.05);
    background: #fef920;
    box-shadow: 0 4px 8px rgba(254, 251, 62, 0.4);
}

.ssc-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar Styling */
.ssc-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ssc-messages::-webkit-scrollbar-thumb {
    background: var(--ssc-yellow);
    border-radius: 3px;
    opacity: 0.5;
}

.ssc-messages::-webkit-scrollbar-thumb:hover {
    background: #e0a800;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ssc-chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .ssc-chat-container {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .ssc-chat-window {
        border-radius: 0;
    }
    
    .ssc-message {
        max-width: 85%;
    }
}
