/**
 * Eden Campaign Chat - Frontend Styles
 */

/* Container */
.ecc-chat-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Notices */
.ecc-notice {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
}

.ecc-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ecc-notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ecc-notice h3 {
    margin: 0 0 10px 0;
}

.ecc-notice-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ecc-notice-dismiss:hover {
    opacity: 1;
}

.ecc-button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Chat Container */
.ecc-chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Messages Area */
.ecc-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.ecc-message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.ecc-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ecc-message-role {
    font-weight: 600;
    font-size: 14px;
}

.ecc-message-user .ecc-message-role {
    color: #2f5022;
}

.ecc-message-assistant .ecc-message-role {
    color: #7c3aed;
}

.ecc-message-system .ecc-message-role {
    color: #6b7280;
}

.ecc-message-system .ecc-message-content {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
}

.ecc-message-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.ecc-message-time {
    font-size: 12px;
    color: #9ca3af;
}

.ecc-message-content {
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ecc-message-user .ecc-message-content {
    background: #e8f5e9;
    border-left: 3px solid #2f5022;
}

.ecc-message-assistant .ecc-message-content {
    background: #f3e8ff;
    border-left: 3px solid #7c3aed;
}

.ecc-message-system .ecc-message-content {
    background: #f3f4f6;
    border-left: 3px solid #6b7280;
    font-style: italic;
}

/* Typing Indicator */
.ecc-typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.ecc-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c3aed;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input Area */
.ecc-input-area {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 20px;
}

.ecc-input-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}

.ecc-input-container textarea:focus {
    outline: none;
    border-color: #2f5022;
    box-shadow: 0 0 0 3px rgba(47, 80, 34, 0.1);
}

.ecc-input-container textarea:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.ecc-input-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.ecc-input-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #6b7280;
}

/* Buttons */
.ecc-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

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

.ecc-button-primary {
    background: #2f5022;
    color: #fff;
}

.ecc-button-primary:hover:not(:disabled) {
    background: #1f3517;
}

.ecc-button-secondary {
    background: #6b7280;
    color: #fff;
}

.ecc-button-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.ecc-button-generate {
    background: #7c3aed;
    color: #fff;
}

.ecc-button-generate:hover:not(:disabled) {
    background: #6d28d9;
}

.ecc-button-large {
    padding: 16px 32px;
    font-size: 16px;
    width: 100%;
    max-width: 400px;
}

.ecc-help-text {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* Access Control Messages */
.ecc-login-required,
.ecc-access-denied,
.ecc-not-configured {
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ecc-login-required .button,
.ecc-access-denied .button,
.ecc-not-configured .button {
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .ecc-messages {
        height: 400px;
    }

    .ecc-input-actions {
        flex-direction: column;
    }

    .ecc-button {
        width: 100%;
    }

    .ecc-button-group {
        flex-direction: column;
    }

    .ecc-button-group a {
        width: 100%;
    }
}

/* Scrollbar Styling */
.ecc-messages::-webkit-scrollbar {
    width: 8px;
}

.ecc-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ecc-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ecc-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}
