@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap');

/* Base styles */
:root {
    --primary-color: #FF3034;
    --primary-dark: #C10003;
    --secondary-color: #66D4FF;
    --secondary-dark: #00A4E6;
    --tertiary-color: #E0DFDF;
    --tertiary-dark: #837E7E;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --body-bg: #f5f7fa;
    --white-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.2s ease-in-out;
    --header-height: 60px;
    --footer-height: 40px;
    --sidebar-width: 280px;
    --font-secondary: 'Barlow Condensed', sans-serif;
    --font-primary: 'Quicksand', sans-serif;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* General Font Styling */

body,
#chatInput,
.conversation-title,
.conversation-content,
.message-content,
.message-timestamp {
	font-family: var(--font-primary);
}

.sidebar-header{
	font-family: var(--font-secondary);
	letter-spacing:1px;
	word-spacing:1px;
}

.user-info,
.nav-link{
	font-family: var(--font-secondary);
	font-size:16px;
	letter-spacing:1px;
	word-spacing:1px;
}

.conversation-time,
.app-info,
.status-text,
.datetime,
.copyright {
	font-family: var(--font-secondary);
	font-size:12px;
	letter-spacing:1px;
	word-spacing:1px;
}

/* Header */
.app-header {
    background-color: var(--white-bg);
    box-shadow: var(--box-shadow);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 2rem;
    max-width: 100%;
    margin: 0 auto;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.25rem 1rem;
    position: relative;
    background-color: var(--tertiary-color);
    border-radius: var(--border-radius);
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: var(--white-bg);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.user-info{
    font-weight: 400;
    margin-right: 1rem;
    color: var(--tertiary-dark);
      letter-spacing: 1px;
    word-spacing: 1px;
}

.user-info label{
    color: var(--tertiary-dark);
    font-weight: 700;
    letter-spacing: 1px;
    word-spacing: 1px;
}

.header-right{
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    color: var(--danger-color);
    font-weight: 500;
    padding: 0.5rem 0;
}

.logout-icon{
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 25px !important;
    background-image: url('/assets/icon_logout.png');
    background-size: contain;
    background-repeat: no-repeat;
}

.logout-icon:hover {
    background-image: url('/assets/icon_logout_h.png');
        background-size: contain;
    background-repeat: no-repeat;
}

/* Footer */
.app-footer {
    background-color: var(--white-bg);
    border-top: 1px solid var(--border-color);
    height: var(--footer-height);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 0.5rem;
}

.status-dot.connected {
    background-color: var(--success-color);
}

/* Login page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--body-bg);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background-color: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

.login-btn {
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.login-btn:hover {
    background-color: var(--primary-dark);
}

.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

/* Chat page */
.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main {
    display: flex;
    flex-grow: 1;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    height: 100vh;
    overflow: hidden; /* Add this to prevent overflow issues */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width); /* Add this to prevent shrinking */
    flex-shrink: 0; /* Add this to prevent shrinking */
    background-color: var(--white-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background-color: var(--primary-dark);
}

.conversation-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.conversation-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.conversation-item.active {
    background-color: rgba(74, 111, 165, 0.1);
}

.conversation-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chat container */
.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: calc(100% - var(--sidebar-width)); /* Add this to ensure proper width */
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-message,
.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.welcome-message {
    margin: auto;
    text-align: center;
    max-width: 600px;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-avatar {
    background-color: rgba(74, 111, 165, 0.1);
}

.user-avatar {
    background-color: rgba(23, 162, 184, 0.1);
}

.message-content {
    background-color: var(--white-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    flex-grow: 1;
}

.user-message .message-content {
    background-color: rgba(74, 111, 165, 0.1);
}

.message-content p {
    margin-bottom: 0.75rem;
}

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

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: var(--body-bg);
}

.auth-card {
    background: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h1 {
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(255, 48, 52, 0.25);
}

.auth-btn, .login-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.auth-btn:hover, .login-btn:hover {
    background-color: var(--primary-dark);
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.form-footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Login specific */
.login-page {
    background-color: var(--body-bg);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 0.75rem 0;
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
}

.message-content p code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    animation: typing 1.4s infinite both;
}

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

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

@keyframes typing {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

.chat-input-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--white-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--box-shadow);
}

#chatInput {
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    max-height: 150px;
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.send-btn:hover {
    background-color: var(--primary-dark);
}

.send-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}


/* Add these CSS rules to sentient.css */

/* User avatar styles based on role */
.user-avatar.creator {
    background-color: rgba(255, 48, 52, 0.1); /* Primary color background */
}

.user-avatar.admin {
    background-color: rgba(255, 193, 7, 0.1); /* Warning color background */
}

.user-avatar.user {
    background-color: rgba(23, 162, 184, 0.1); /* Info color background - current default */
}

/* User Menu Styles */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color:var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.user-avatar:hover {
    background-color: var(--primary-dark);
        transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 1rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    padding: 0 1rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.user-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

.user-details {
    margin-left: 1rem;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
}

.user-email {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #34495e;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    margin-right: 0.75rem;
    color: #7f8c8d;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 0.5rem 0;
}

/* Hover effects */

/* Ensure the logo has proper styling */
.app-title img.logo {
    height: 36px;
    vertical-align: middle;
    margin-right: 10px;
}

/* Header layout */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .chat-container {
        height: 60%;
    }
    
    .welcome-message,
    .message {
        max-width: 100%;
    }
}
