@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Fabritec Brand Colors */
    --fabritec-green: #8DC63F;
    --fabritec-green-hover: #7AB832;
    --fabritec-green-light: #B8E068;
    --fabritec-white: #fff;
    --fabritec-black: rgba(0, 0, 0, 0.8);
    --fabritec-black-light: rgba(0, 0, 0, 0.6);
    --fabritec-black-subtle: rgba(0, 0, 0, 0.1);
    
    /* Updated Color Scheme */
    --bg-primary: #f8fafb;
    --bg-secondary: #f1f5f4;
    --border-color: #e1e8e4;
    --text-primary: var(--fabritec-black);
    --text-secondary: var(--fabritec-black-light);
    --text-light: var(--fabritec-white);
    --accent-primary: var(--fabritec-green);
    --accent-primary-hover: var(--fabritec-green-hover);
    --accent-light: var(--fabritec-green-light);
    --shadow-color: rgba(141, 198, 63, 0.1);
    --border-radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
::-webkit-scrollbar {
    width: 4px;  /* For vertical scrollbar */
    height: 2px; /* For horizontal scrollbar */
}

/* Scrollbar track (background) */
::-webkit-scrollbar-track {
    background: rgb(141 198 63 / 1%);
    border-radius: 4px;
}

/* Scrollbar thumb (the draggable part) */
::-webkit-scrollbar-thumb {
    background: #8dc63f;
    border-radius: 4px;
}

/* Scrollbar thumb on hover */
::-webkit-scrollbar-thumb:hover {
    background: #8dc63f;
}
body {
    font-family: 'Inter', sans-serif;
    background: #e8e8e8;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 700px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.header {
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0% 100%);
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgb(0 0 0 / 76%) 100%);
    color: var(--fabritec-white);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
    order: 1;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    order: 2;
    flex-grow: 1;
    padding-bottom: 15px;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fabritec-white);
    margin: 0;
}

.subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    order: 3;
}

.username {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fabritec-white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #f9f9f9;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 90%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    flex-direction: column;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--fabritec-green) 0%, var(--fabritec-green-hover) 100%);
    color: var(--fabritec-white);
    border: 2px solid var(--fabritec-white);
}

.message.assistant .message-avatar {
    background-color: var(--fabritec-white);
    border: 2px solid var(--fabritec-green);
    color: var(--fabritec-green);
    align-self: flex-start;
}

.message-content {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--bg-secondary);
    line-height: 1.5;
    width: 100%;
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 1) 100%);
    color: var(--fabritec-white);
   
}

.message.assistant .message-content {
    width: 100%;
    background-color: var(--fabritec-white);
    border: 1px solid var(--fabritec-green);
  
}

.message-content p {
    margin: 0;
}

.message-content strong {
    color: var(--fabritec-green);
    font-weight: 600;
}

.message.user .message-content strong {
    color: var(--fabritec-white);
    font-weight: 600;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin-bottom: 0.25rem;
}

.message-content code {
    background-color: var(--fabritec-black-subtle);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--fabritec-green);
}

.chat-input-area {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9f9f9;
    border-top: 1px solid #e7e5e4;
}

.user-input {
    flex-grow: 1;
    padding: 0.6rem 1.5rem;
    border-radius: 50px; /* Pill shape */
    border: 1px solid var(--border-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    transition: all 0.2s ease;
    background-color: #f9f9f9;
}

.user-input:focus {
    outline: none;
    border-color: var(--fabritec-green);
    box-shadow: 0 0 0 2px var(--shadow-color);
}

.send-btn {
    height: 40px;
    width: 40px;
    border-radius: 50%; /* Make it a circle */
    border: none;
    background: var(--fabritec-green);
    color: var(--fabritec-white);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.send-btn:hover {
    background: var(--fabritec-green-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Rating Section Styles */
.rating-section {
    display: flex;
    margin-top: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: var(--border-radius);
    border: 1px solid var(--fabritec-green);
    width: 100%;
    box-sizing: border-box;
    align-items: baseline;
    justify-content: space-between;
}

.rating-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.rating-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--fabritec-green);
    border-radius: 6px;
    background-color: var(--fabritec-white);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--fabritec-green-hover);
}

.rating-btn.good:hover {
    border-color: var(--fabritec-green);
    color: var(--fabritec-green);
    background-color: rgba(141, 198, 63, 0.1);
}

.rating-btn.bad:hover {
    border-color: #ef4444;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.feedback-form {
    margin-top: 1rem;
    margin-left: 1rem;
    background-color: var(--fabritec-white);
    border-radius: 6px;
    border: 1px solid var(--fabritec-green);
}

.feedback-form p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feedback-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.feedback-options input[type="checkbox"] {
    margin: 0;
    accent-color: var(--fabritec-green);
}

.feedback-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--fabritec-green);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
    background-color: var(--fabritec-white);
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--fabritec-green-hover);
    
}

.submit-feedback-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--fabritec-green) 0%, var(--fabritec-green-hover) 100%);
    color: var(--fabritec-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    
}

.submit-feedback-btn:hover {
    background: linear-gradient(135deg, var(--fabritec-green-hover) 0%, #6FA829 100%);
    transform: translateY(-1px);
    
}

.rating-success,
.feedback-success {
    color: var(--fabritec-green);
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;    
}



@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        border: none;
        border-top: 2px solid var(--fabritec-green);
        border-bottom: 2px solid var(--fabritec-green);
    }
    .header, .chat-messages, .chat-input-area {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .header-content {
        gap: 1rem;
        justify-content: flex-start;
    }
    
    .logo {
        height: 35px;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
}

/* Standalone Logout Button - Completely separate from chat interface */
.logout-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
}

.user-info-standalone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.username-standalone {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.logout-btn-standalone {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--accent-primary);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.logout-btn-standalone:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
  
}

.logout-btn-standalone:active {
    transform: translateY(0);
}

/* Mobile responsiveness for standalone logout */
@media (max-width: 768px) {
    .logout-container {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    
    .user-info-standalone {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .username-standalone {
        padding: 0.2rem 0.4rem;
    }
    
    .logout-btn-standalone {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
} 