/**
 * Magazine-style CSS for AI Chat Widget
 */
:root {
    /* Brand Colors */
    --color-background: #ffffff;
    --color-text: #131313;
    --color-primary: #ADDDBF;
    /* Light Green */
    --color-secondary: #F6CAC3;
    /* Light Pink */
    --color-accent: #B28F2E;
    /* Gold/Bronze */

    /* Typography */
    --font-primary: 'Lato', sans-serif;
    --font-heading: 'Francois One', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent body scroll, handle scroll in messages */
    padding: 2rem;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1440px;
    height: 100%;
    gap: 2rem;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--color-text);
    background: var(--color-background);
}

.chat-header {
    padding: 1rem;
    border-bottom: 2px solid var(--color-text);
    text-align: left;
    background-color: var(--color-primary);
}

.chat-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.chat-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--color-background);
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px solid var(--color-text);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-text);
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message-content {
    padding: 1rem;
    font-size: 1.05rem;
    line-height: 1.5;
    border: 1px solid var(--color-text);
    position: relative;
}

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

.user-message .message-content {
    background-color: var(--color-text);
    color: var(--color-background);
}

.user-message .message-content::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 10px;
    height: 10px;
    background-color: var(--color-text);
    transform: rotate(45deg);
    border-right: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-text);
}

.assistant-message {
    align-self: flex-start;
}

.assistant-message .message-content {
    background-color: var(--color-secondary);
    color: var(--color-text);
}

.assistant-message .message-content::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background-color: var(--color-secondary);
    transform: rotate(45deg);
    border-right: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-text);
}

/* Markdown specific styling inside assistant messages */
.assistant-message .message-content p {
    margin-bottom: 0.75rem;
}

.assistant-message .message-content p:last-child {
    margin-bottom: 0;
}

.assistant-message .message-content strong {
    font-weight: 700;
}

.assistant-message .message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border: 1px solid var(--color-text);
    overflow-x: auto;
    margin-top: 0.5rem;
}

.assistant-message .message-content code {
    font-family: monospace;
}

.typing-indicator {
    font-size: 0.9rem;
    color: var(--color-text);
    font-style: italic;
    opacity: 0.7;
    margin-bottom: -1rem;
}

.chat-input-container {
    display: flex;
    border-top: 2px solid var(--color-text);
    background-color: var(--color-background);
}

#user-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    background: transparent;
    color: var(--color-text);
}

#user-input::placeholder {
    color: rgba(19, 19, 19, 0.5);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.send-button {
    background-color: transparent;
    border: none;
    border-left: 2px solid var(--color-text);
    color: var(--color-text);
    padding: 0 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
    color: var(--color-text);
}

/* -------------------------------------------------------------------------
   Feedback Panel Styles
   ------------------------------------------------------------------------- */
.feedback-container {
    flex: 1;
    border: 2px solid var(--color-text);
    background: #f8fafc;
    /* slightly off-white like the main site */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.feedback-header {
    padding: 1rem;
    border-bottom: 2px solid var(--color-text);
    text-align: left;
    background-color: var(--color-text);
    color: var(--color-background);
}

.feedback-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.feedback-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.feedback-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: rgba(19, 19, 19, 0.5);
}

.empty-icon {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(19, 19, 19, 0.5);
    border-radius: 50%;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(19, 19, 19, 0.2);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(19, 19, 19, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(19, 19, 19, 0);
    }
}

.feedback-results {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    border-bottom: 4px solid var(--color-primary);
    padding-bottom: 1rem;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 6rem;
    line-height: 1;
    color: var(--color-primary);
}

.score-label {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-text);
    margin-left: 0.5rem;
}

.fb-section h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.summary-section div {
    font-size: 1.1rem;
    line-height: 1.6;
}

.fb-grid {
    display: flex;
    gap: 1.5rem;
}

.card-section {
    flex: 1;
    background: var(--color-background);
    border: 1px solid var(--color-text);
    padding: 1.5rem;
}

.card-section div {
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-section ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

.card-section li {
    margin-bottom: 0.5rem;
}

/* Custom Scrollbar for feedback */
.feedback-container::-webkit-scrollbar {
    width: 8px;
}

.feedback-container::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px solid var(--color-text);
}

.feedback-container::-webkit-scrollbar-thumb {
    background: var(--color-text);
}