:root {
    --primary-color: #c6bb7f;
    --secondary-color: #a39865;
    --bg-color: #161316;
    --card-bg: #161316;
    --text-color: #FFFFFF;
    --muted-color: #cccccc;
    --input-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(198, 187, 127, 0.2);
    --user-msg-bg: linear-gradient(135deg, #c6bb7f2e, #a398652b);
    --ai-msg-bg: rgba(255, 255, 255, 0.05);
    --danger-color: #ea4335;
    --success-color: #34a853;
    --warning-color: #fbbc04;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #2a2d3d 0%, #161316 100%);
    min-height: 100vh;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-color);
    padding-top: 100px;
    /* Space for floating navbar */
}

.text-muted {
    color: var(--muted-color) !important;
}

/* Glassmorphism Navbar */
.navbar {
    background: rgba(22, 19, 22, 0.6) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    z-index: 1000;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px;
    padding: 8px 16px !important;
    transition: all 0.3s ease;
    font-weight: 500;
    margin: 0 5px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(198, 187, 127, 0.1);
    box-shadow: 0 2px 10px rgba(198, 187, 127, 0.1);
}

/* Adjust for mobile */
@media (max-width: 991px) {
    .navbar {
        width: 100%;
        top: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-collapse {
        background: rgba(22, 19, 22, 0.95);
        border-radius: 15px;
        padding: 20px;
        margin-top: 10px;
        border: 1px solid var(--border-color);
    }
}

.navbar-brand,
.nav-link {
    color: var(--text-color) !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Chat Styles */
.chat-container {
    max-width: 1000px;
    margin: 0 auto;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.chat-card {
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: none;
    box-shadow: none;
}

.chat-header {
    background: transparent;
    color: var(--text-color);
    padding: 20px;
    text-align: center;
    display: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: var(--muted-color) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(198, 187, 127, 0.3);
    border-radius: 3px;
}

.message {
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-ai {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 15px 25px;
    border-radius: 20px;
    position: relative;
    line-height: 1.6;
    font-size: 1rem;
}

.message-user .message-content {
    background: var(--user-msg-bg);
    color: #e9e9e9;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 15px rgba(198, 187, 127, 0.2);
    font-weight: 500;
}

.message-ai .message-content {
    background: var(--ai-msg-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.message-user .message-avatar {
    display: none;
}

.message-ai .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 15px rgba(198, 187, 127, 0.3);
}

.citations {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.citation-item {
    display: inline-block;
    background: rgba(198, 187, 127, 0.1);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-top: 5px;
    border: 1px solid rgba(198, 187, 127, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.citation-item:hover {
    background: rgba(198, 187, 127, 0.2);
    border-color: rgba(198, 187, 127, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 187, 127, 0.3);
}

.chat-input-container {
    padding: 20px 0;
    background: transparent;
    position: relative;
    border-top: none;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 15px;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(198, 187, 127, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 1rem;
    color: white;
}

.chat-input:focus {
    outline: none;
    box-shadow: none;
}

.chat-input::placeholder {
    color: var(--muted-color);
    opacity: 0.7;
}

.send-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(198, 187, 127, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 5px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--muted-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.welcome-badge {
    background: rgba(198, 187, 127, 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid rgba(198, 187, 127, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.welcome-message h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(to right, #fff, #c6bb7f);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.welcome-message p {
    color: var(--muted-color);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.example-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 800px;
}

.example-question {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--muted-color);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.example-question:hover {
    background: rgba(198, 187, 127, 0.1);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.timestamp {
    font-size: 0.75rem;
    color: var(--muted-color);
    opacity: 0.8;
    margin-top: 8px;
}

.message-user .timestamp {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

/* Admin Panel Styles - Dark Mode Adaptation */
.main-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    color: var(--text-color);
}

.card-header {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-weight: 600;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.upload-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.btn-file {
    border: 2px dashed var(--border-color);
    background: transparent;
    padding: 20px 40px;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: var(--muted-color);
}

.btn-file:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.document-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
}

.document-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #282a37;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(198, 187, 127, 0.3);
}

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

.btn-danger:hover {
    background: #d33426;
}

.store-info {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    color: var(--text-color);
}

/* Markdown Styles */
.message-content p {
    margin-bottom: 10px;
}

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

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: #ff79c6;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content pre code {
    background: transparent;
    padding: 0;
    color: #f8f8f2;
}

/* KPD Result Styles */
.kpd-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.kpd-primary {
    background: rgba(198, 187, 127, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(198, 187, 127, 0.15);
}

.kpd-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.kpd-code {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: 'Consolas', monospace;
    margin: 5px 0;
    text-shadow: 0 2px 10px rgba(198, 187, 127, 0.3);
}

.kpd-category {
    font-size: 1.1rem;
    color: white;
    font-weight: 500;
}

.kpd-section {
    margin-top: 10px;
}

.kpd-section-title {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.kpd-similar-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.kpd-similar-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.2s ease;
}

.kpd-similar-item:hover {
    background: rgba(198, 187, 127, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.kpd-code-small {
    font-family: 'Consolas', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.kpd-category-small {
    font-size: 0.85rem;
    color: var(--muted-color);
    line-height: 1.3;
}

.kpd-description-text {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
}

.typing-text {
    font-style: italic;
    color: var(--muted-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Landing Page Enhancements */
.landing-hero {
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(198, 187, 127, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.demo-section {
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 40px 0;
}

.demo-container {
    max-width: 900px;
    margin: 0 auto;
    perspective: 1000px;
}

.demo-card {
    background: rgba(22, 19, 22, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: rotateX(5deg);
    transition: transform 0.5s ease;
}

.demo-card:hover {
    transform: rotateX(0deg);
}

.demo-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.demo-content {
    padding: 20px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.cta-section {
    text-align: center;
    padding: 80px 20px;
    background: radial-gradient(circle at center, rgba(198, 187, 127, 0.15) 0%, transparent 70%);
}

.cta-text {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.4;
    color: white;
    font-weight: 300;
}

.cta-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* Footer Styles */
.footer {
    background: rgba(22, 19, 22, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
    color: var(--text-color);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.footer-logo {
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    color: white !important;
    text-decoration: none;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.footer h5 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: var(--muted-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted-color);
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.footer-contact-item:hover {
    color: white;
}

.footer-contact-item i {
    color: var(--primary-color);
    font-size: 1rem;
    background: rgba(198, 187, 127, 0.1);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.footer-contact-item a {
    color: inherit;
    text-decoration: none;
}