/* Custom styles for LLM Comparison App */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    
    /* EmergingX Brand Colors */
    --gradient-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-accent: linear-gradient(135deg, #e94560 0%, #f27121 100%);
    --accent-magenta: #e94560;
    --white: #ffffff;
    --font-display: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: 80px;
}

.h6, h6{
    font-size: 0.85rem;
}
/* Navigation */
.navbar {
    background: var(--gradient-primary) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    //padding: 1rem 0;
    z-index: 1030;
}

.navbar.scrolled {
    background: rgba(26, 26, 46, 0.95) !important;
    box-shadow: var(--shadow-medium);
    padding: 0.5rem 0;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Flash messages positioning for fixed navbar */
.alert {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Ensure proper spacing for fixed navbar */
.container {
    position: relative;
}


.navbar-brand {
    font-weight: 600;
}

.navbar-brand .brand-text {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.navbar-nav .nav-link {
    color: var(--white) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-magenta) !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.badge {
    font-size: 0.75em;
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #d1ecf1;
    color: #055160;
}

/* Custom components */
.result-card {
    border-left: 4px solid var(--primary-color);
}

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

.result-card.error {
    border-left-color: var(--danger-color);
}

.score-badge {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.model-card {
    transition: transform 0.2s ease-in-out;
}

.model-card:hover {
    transform: translateY(-2px);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #fff;
    }
    
    .card {
        background-color: #343a40;
        color: #fff;
    }
    
    .bg-light {
        background-color: #495057 !important;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-dashed {
    border-style: dashed !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Markdown and Code Block Styles */
.response-content {
    line-height: 1.6;
    font-size: 0.95rem;
}

.response-content h1,
.response-content h2,
.response-content h3,
.response-content h4,
.response-content h5,
.response-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.response-content h1 { font-size: 1.5rem; }
.response-content h2 { font-size: 1.3rem; }
.response-content h3 { font-size: 1.1rem; }

.response-content p {
    margin-bottom: 1rem;
    color: #444;
}

.response-content ul,
.response-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.response-content li {
    margin-bottom: 0.25rem;
}

.response-content blockquote {
    border-left: 4px solid #e9ecef;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

.response-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.response-content th,
.response-content td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    text-align: left;
}

.response-content th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Code Block Styles */
.code-block {
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
}

.code-block .highlight {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.code-block .highlight pre {
    background-color: transparent;
    border: none;
    padding: 1rem;
    margin: 0;
}

/* Inline code */
.response-content code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
    color: #e83e8c;
}

/* Syntax highlighting theme */
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #999988; font-style: italic }
.highlight .err { color: #a61717; background-color: #e3d2d2 }
.highlight .k { color: #000000; font-weight: bold }
.highlight .o { color: #000000; font-weight: bold }
.highlight .cm { color: #999988; font-style: italic }
.highlight .cp { color: #999999; font-weight: bold }
.highlight .c1 { color: #999988; font-style: italic }
.highlight .cs { color: #999999; font-weight: bold; font-style: italic }
.highlight .gd { color: #000000; background-color: #ffdddd }
.highlight .ge { color: #000000; font-style: italic }
.highlight .gr { color: #aa0000 }
.highlight .gh { color: #999999 }
.highlight .gi { color: #000000; background-color: #ddffdd }
.highlight .go { color: #888888 }
.highlight .gp { color: #555555 }
.highlight .gs { font-weight: bold }
.highlight .gu { color: #800080; font-weight: bold }
.highlight .gt { color: #aa0000 }
.highlight .kc { color: #000000; font-weight: bold }
.highlight .kd { color: #000000; font-weight: bold }
.highlight .kn { color: #000000; font-weight: bold }
.highlight .kp { color: #000000; font-weight: bold }
.highlight .kr { color: #000000; font-weight: bold }
.highlight .kt { color: #445588; font-weight: bold }
.highlight .m { color: #009999 }
.highlight .s { color: #d14 }
.highlight .na { color: #008080 }
.highlight .nb { color: #0086b3 }
.highlight .nc { color: #445588; font-weight: bold }
.highlight .no { color: #008080 }
.highlight .ni { color: #800080 }
.highlight .ne { color: #990000; font-weight: bold }
.highlight .nf { color: #990000; font-weight: bold }
.highlight .nn { color: #555555 }
.highlight .nt { color: #000080 }
.highlight .nv { color: #008080 }
.highlight .ow { color: #000000; font-weight: bold }
.highlight .w { color: #bbbbbb }
.highlight .mb { color: #009999 }
.highlight .mf { color: #009999 }
.highlight .mh { color: #009999 }
.highlight .mi { color: #009999 }
.highlight .mo { color: #009999 }
.highlight .sa { color: #d14 }
.highlight .sb { color: #d14 }
.highlight .sc { color: #d14 }
.highlight .dl { color: #d14 }
.highlight .sd { color: #d14 }
.highlight .s2 { color: #d14 }
.highlight .se { color: #d14 }
.highlight .sh { color: #d14 }
.highlight .si { color: #d14 }
.highlight .sx { color: #d14 }
.highlight .sr { color: #009926 }
.highlight .s1 { color: #d14 }
.highlight .ss { color: #990073 }
.highlight .bp { color: #999999 }
.highlight .vc { color: #008080 }
.highlight .vg { color: #008080 }
.highlight .vi { color: #008080 }
.highlight .il { color: #009999 }

/* Dark mode code blocks */
@media (prefers-color-scheme: dark) {
    .response-content {
        color: #e9ecef;
    }
    
    .response-content h1,
    .response-content h2,
    .response-content h3,
    .response-content h4,
    .response-content h5,
    .response-content h6 {
        color: #fff;
    }
    
    .response-content p {
        color: #e9ecef;
    }
    
    .response-content blockquote {
        border-left-color: #495057;
        color: #adb5bd;
    }
    
    .response-content th {
        background-color: #495057;
        color: #fff;
    }
    
    .response-content th,
    .response-content td {
        border-color: #495057;
    }
    
    .code-block pre {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .code-block .highlight {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .response-content code {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #f687b3;
    }
}

/* Copy Button Styles */
.copy-button {
    transition: all 0.2s ease-in-out;
}

.copy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.copy-button:active {
    transform: translateY(0);
}

/* Toast Notification Styles - Centered */
.toast-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    padding: 0 !important;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
}

.toast {
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    position: relative !important;
    transform: none !important;
    animation: toastFadeIn 0.3s ease-out;
    margin: 0 !important;
}

/* Override Bootstrap's default toast positioning */
.toast-container.position-fixed {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.toast .toast-body {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive toast styles */
@media (max-width: 768px) {
    .toast {
        min-width: 300px;
        max-width: 90vw;
        margin: 0 1rem;
    }
    
    .toast .toast-body {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .toast {
        min-width: 280px;
        max-width: 95vw;
        margin: 0 0.5rem;
    }
    
    .toast .toast-body {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Copy Success Animation */
.copy-success {
    animation: copySuccess 0.6s ease-in-out;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Result Card Hover Effects */
.result-card {
    transition: all 0.3s ease;
}

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

/* Copy All Button */
.copy-all-button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.copy-all-button:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* HTML Copy Button Styles */
.copy-html-button {
    transition: all 0.2s ease-in-out;
    background: linear-gradient(45deg, #6c757d, #495057);
    border: none;
    color: white;
}

.copy-html-button:hover {
    background: linear-gradient(45deg, #495057, #343a40);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.copy-all-html-button {
    background: linear-gradient(45deg, #6c757d, #495057);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.copy-all-html-button:hover {
    background: linear-gradient(45deg, #495057, #343a40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108,117,125,0.3);
}

/* Button Group Improvements */
.btn-group .btn {
    border-radius: 0.375rem !important;
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* EmergingX Branding Styles */
.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.navbar-brand img {
    transition: all 0.3s ease;
    filter: brightness(1.1);
    border-radius: 4px;
}

.navbar-brand:hover img {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.brand-text {
    line-height: 1.2;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.brand-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin-top: -2px;
}

/* Fix alignment on smaller screens */
@media (max-width: 768px) {
    .brand-text {
        position: relative;
        top: -6px;
    }
}

/* Footer Branding */
footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

footer a {
    color: #0d6efd;
    font-weight: 500;
}

footer a:hover {
    color: #0b5ed7;
    text-decoration: underline !important;
}

/* Responsive Branding */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .app-name {
        font-size: 1rem;
    }
    
    .brand-subtitle {
        font-size: 0.65rem;
    }
    
    .navbar-brand img {
        height: 28px;
    }
    
    footer .col-md-4 {
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    footer .col-md-4:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 65px;
    }
    
    .navbar-brand img {
        height: 24px;
    }
    
    .app-name {
        font-size: 0.9rem;
    }
    
    .brand-subtitle {
        font-size: 0.6rem;
    }
}

/* Always show navbar items (no hamburger collapse) */
.navbar-collapse {
    display: flex !important;
    flex-grow: 1 !important;
    justify-content: space-between;
}

/* Force navbar to stay in one row */
.navbar .container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.navbar-brand {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Ensure main nav items stay on left, user dropdown on right */
.navbar-nav.me-auto {
    flex-shrink: 1;
}

.navbar-nav:not(.me-auto) {
    flex-shrink: 0;
    margin-left: auto;
}

/* Responsive Navigation - Hide text on smaller screens */
@media (max-width: 992px) {
    /* Hide nav text, show icons only */
    .navbar-nav .nav-text {
        display: none;
    }
    
    /* Adjust nav link padding for icon-only view */
    .navbar-nav .nav-link {
        padding: 0.4rem 0.5rem !important;
    }
    
    /* Center icons */
    .navbar-nav .nav-link i {
        margin: 0 !important;
        font-size: 1rem;
    }
    
    /* Compact navbar items - force single row */
    .navbar-nav {
        gap: 0.15rem;
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    /* Smaller logo on mobile */
    .navbar-brand {
        margin-right: 0.3rem !important;
    }
    
    .navbar-brand img {
        height: 24px;
    }
    
    .app-name {
        font-size: 0.85rem;
    }
    
    .brand-subtitle {
        font-size: 0.55rem;
    }
    
    /* Ensure container fits in one row */
    .navbar .container {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        max-width: 100%;
    }
    
    /* Compact nav items */
    .navbar-nav.me-auto {
        margin-right: 0.3rem !important;
        flex-shrink: 1;
    }
    
    /* User dropdown compact */
    .navbar-nav .dropdown-toggle {
        padding: 0.4rem 0.5rem !important;
    }
}

@media (max-width: 768px) {
    /* Even more compact on mobile */
    .navbar-nav .nav-link {
        padding: 0.35rem 0.4rem !important;
    }
    
    .navbar-nav .nav-link i {
        font-size: 0.95rem;
    }
    
    /* Very compact navbar items */
    .navbar-nav {
        gap: 0.1rem;
    }
    
    /* Hide brand subtitle on very small screens */
    .brand-subtitle {
        display: none !important;
    }
    
    .app-name {
        font-size: 0.8rem;
    }
    
    /* Smaller logo */
    .navbar-brand img {
        height: 20px;
    }
    
    /* Tighter container */
    .navbar .container {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }
}

@media (max-width: 576px) {
    /* Ultra-compact for very small phones */
    .navbar-nav .nav-link {
        padding: 0.3rem 0.35rem !important;
    }
    
    .navbar-nav .nav-link i {
        font-size: 0.9rem;
    }
    
    .navbar-nav {
        gap: 0.05rem;
    }
    
    .app-name {
        font-size: 0.75rem;
    }
    
    .navbar-brand img {
        height: 18px;
    }
}

