/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #2ecc71;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}






/* Navbar Customization */
.navbar-dark.bg-primary {
    background-color: var(--primary-color) !important;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Card Styles */
.card {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Button Styles */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.alert.alert-warning:not(.alert-persistent) {
    display: none;
}
.alert.alert-warning.visible,
.alert.alert-warning.alert-persistent {
    display: block !important;
}

/* Form Styles */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

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

/* static/css/styles.css */
.text-muted {
    color: #6c757d !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Table Styles */
.table {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

/* List Group Styles */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem 1.25rem;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Footer Styles */
.footer {
    margin-top: auto;
    background-color: var(--light-color) !important;
}

/* Dashboard Cards */
.stat-card {
    border-left: 5px solid var(--secondary-color);
}

.stat-card.stat-organizations {
    border-left-color: var(--accent-color);
}

.stat-card.stat-users {
    border-left-color: var(--secondary-color);
}

.stat-card.stat-projects {
    border-left-color: var(--success-color);
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 600;
}

/* Login & Authentication Pages */
.auth-card {
    max-width: 450px;
    margin: 3rem auto;
}

.auth-card .card-header {
    text-align: center;
    padding: 1.5rem;
}

.auth-card .card-body {
    padding: 2rem;
}

/* Utils */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 0.25rem;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}
/* Enhanced Chat Message Formatting */
.chat-msg.bot {
    background: #f9f9f9;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Typography */
.chat-msg.bot h1, .chat-msg.bot h2, .chat-msg.bot h3, 
.chat-msg.bot h4, .chat-msg.bot h5, .chat-msg.bot h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

.chat-msg.bot h1 { font-size: 1.8em; }
.chat-msg.bot h2 { font-size: 1.5em; }
.chat-msg.bot h3 { font-size: 1.3em; }
.chat-msg.bot h4 { font-size: 1.2em; }
.chat-msg.bot h5 { font-size: 1.1em; }
.chat-msg.bot h6 { font-size: 1em; }

.chat-msg.bot p {
    margin-bottom: 1em;
}

.chat-msg.bot strong {
    font-weight: 600;
}

.chat-msg.bot em {
    font-style: italic;
}

/* Links */
.chat-msg.bot a {
    color: #0066cc;
    text-decoration: underline;
}

.chat-msg.bot a:hover {
    color: #004499;
}

/* Lists */
.chat-msg.bot ul, .chat-msg.bot ol {
    margin: 1em 0;
    padding-left: 2em;
}

.chat-msg.bot li {
    margin-bottom: 0.5em;
    display: list-item;
}

.chat-msg.bot ul li {
    list-style-type: disc;
}

.chat-msg.bot ol li {
    list-style-type: decimal;
}

.chat-msg.bot li > ul, 
.chat-msg.bot li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Code formatting */
.chat-msg.bot code {
    background-color: #f0f0f0;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.chat-msg.bot pre {
    background-color: #f0f0f0;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.chat-msg.bot pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
    white-space: pre;
}

/* Blockquotes */
.chat-msg.bot blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    margin-left: 0;
    color: #555;
}

/* Tables */
.chat-msg.bot table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.chat-msg.bot th, .chat-msg.bot td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.chat-msg.bot th {
    background-color: #f2f2f2;
    font-weight: 600;
}

/* References/citations */
.chat-msg.bot .reference-citation {
    font-size: 0.85em;
    color: #555;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
    font-style: italic;
}

/* Images */
.chat-msg.bot img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .chat-msg.bot {
        padding: 12px;
    }
    
    .chat-msg.bot ul, .chat-msg.bot ol {
        padding-left: 1.5em;
    }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .card-title {
        font-size: 1.25rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}