/* Root Variables */
:root {
    --primary-color: #2d6c89;
    --secondary-color: #f0f4f8;
    --accent-color: #e6f2ff;
    --text-color: #333;
    --background-color: #ffffff;
    --border-radius: 12px;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --guidance-color: orange;
    --pending-color: #ffc107;
    --complete-color: green;
}

/* Any custom CSS from existing template */


/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Container */
.header-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--background-color);
    box-shadow: 0 2px 4px var(--shadow-light);
    padding: 10px;
    height: 60px;
}

.logo-container {
    flex-shrink: 0;
    z-index: 10;
}

.logo-container img {
    height: 40px;
}

/* Dashboard Styles */
.dashboard-container {
    position: absolute;
    top: 0;
    left: 250px;
    right: 100px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.dashboard {
    display: flex;
    gap: 20px;
    background-color: var(--secondary-color);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
}

.dashboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    padding: 10px;
    background-color: transparent; /* Changed from var(--background-color) */
    border-radius: var(--border-radius);
    /* Removed box-shadow */
}

.dashboard-label {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
    font-size: 14px;
}

.dashboard-value {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 50%;
    min-width: 25px;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow-light);
}

/* Dashboard Item Colors */
.dashboard-item.guidance-only .dashboard-label { color: var(--guidance-color); }
.dashboard-item.pending-approval .dashboard-label { color: var(--pending-color); }
.dashboard-item.complete .dashboard-label { color: var(--complete-color); }

/* Remove Knowledge Base and Bottom Menu */
.heading {
    display: none;
}

/* Tab Container */
.tab-container {
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    box-shadow: 0 2px 4px var(--shadow-light);
    padding: 0;
    position: relative;
    width: 100%;
    height: 50px;
}

/* Tab Navigation Buttons */
.tab-nav-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    z-index: 2;
    transition: all 0.3s ease;
    margin: 0 5px;
    border-radius: var(--border-radius);
}

.tab-nav-btn:hover {
    background-color: var(--accent-color);
}

/* Tab Navigation Wrapper */
.tab-nav-wrapper {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 5px;
}

.tab-nav-wrapper::-webkit-scrollbar {
    display: none;
}

/* Tab Layout */
.tab {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    height: 100%;
}

.tablinks {
    padding: 10px 15px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    white-space: nowrap;
    position: relative;
    font-size: 14px;
}

.tablinks:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.tablinks.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.tablinks.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 1px 2px var(--shadow-light);
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--background-color);
    box-shadow: -2px 0 5px var(--shadow-light);
    z-index: 1000;
    transition: right 0.3s ease;
    padding-top: 60px;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-section {
    padding: 20px;
    border-bottom: 1px solid var(--accent-color);
}

.side-menu-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
}

.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.side-menu-list li {
    margin: 8px 0;
}

.side-menu-list a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.side-menu-list a:hover {
    color: var(--primary-color);
    background-color: var(--accent-color);
}

/* Content Area */
.scrollArea {
    background-color: var(--background-color);
    padding: 15px;
    margin: 10px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.tabcontent {
    display: none;
}

.tabcontent.active {
    display: block;
}

/* Table Styles */
.detaila, .detailb {
    padding: 15px;
    vertical-align: top;
    border-bottom: 1px solid var(--accent-color);
}

.detaila {
    width: 35%;
    font-weight: bold;
    color: var(--primary-color);
}

.detailb {
    width: 65%;
    background-color: var(--secondary-color);
}

/* Edit Form */
.edit {
    background-color: var(--background-color);
    padding: 20px;
    margin: 10px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.edit table {
    width: 100%;
}

.edit input[type="text"],
.edit textarea,
.edit select,
.edit input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
    font-size: 14px;
}

.edit input[type="text"]:focus,
.edit textarea:focus,
.edit select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45,108,137,0.1), 0 2px 4px var(--shadow-light);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
    font-size: 14px;
    margin: 5px;
}

.radio-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* File Upload Container */
.file-upload-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.file-upload-container input[type="text"] {
    flex: 1;
}

.file-upload-container input[type="file"] {
    padding: 8px;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px var(--shadow-light);
    background: white;
}

/* Knowledge Base Select */
#KB {
    width: 100%;
    padding: 8px;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent-color);
    margin-top: 10px;
    box-shadow: 0 2px 4px var(--shadow-light);
    font-size: 14px;
}

/* Tools Column */
.tools {
    white-space: nowrap;
    padding: 0 10px;
}

.tools img {
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 5px;
}

.tools img:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
    }

    .dashboard-container {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    .dashboard {
        flex-direction: column;
        align-items: stretch;
    }

    .side-menu {
        width: 100%;
    }

    .edit table td {
        display: block;
        width: 100%;
    }
    
    .radio-group {
        flex-direction: column;
    }
}

/* Base styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Initial upload page styles */
.upload-container {
    background-color: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    margin: 50px auto;
}

.headline {
    font-size: 24px;
    margin-bottom: 1rem;
}

.turbo-logo {
    width: 400px;
    height: auto;
    margin-bottom: 1rem;
}

.upload-icon-container {
    cursor: pointer;
    margin-top: -1px;
}

.upload-icon {
    width: 48px;
    height: 48px;
}

#file-name {
    margin-top: 1rem;
    font-style: italic;
}

#processing-message {
    display: none;
    color: #008CBA;
    font-weight: bold;
    margin-top: 1rem;
}

/* Search page layout */
#search-container {
    display: flex;
    height: calc(100vh - 40px);
}

/* Left column styles */
.left-column {
    flex: 2;
    display: flex;
    flex-direction: column;
    margin-right: 20px;
}

.search-results {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Search box container styles */
.search-box-container {
    position: sticky;
    bottom: 0;
    background-color: #f0f0f0;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.search-box-container input {
    flex-grow: 1;
    padding: 12px 50px 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.search-box-container input:focus {
    outline: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.search-box-container .upload-icon-container {
    position: absolute;
    right: 10px;
    cursor: pointer;
}

.search-box-container .upload-icon {
    width: 32px;
    height: 32px;
}

/* Right column styles */
.right-column {
    flex: 1;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 140px);
    position: relative;
    padding: 15px;
    margin-bottom: 70px; /* Space for download button */
    overflow: hidden; /* Prevent content from spilling out */
}

#qa-list {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    scroll-behavior: smooth;
}

/* Large centered upload display */
.initial-upload-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 20px;
}

.large-upload-icon {
    width: 144px;
    height: 144px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.large-upload-icon:hover {
    transform: scale(1.05);
}

.upload-text {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

/* Search results styles */
.result-item {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-item:hover {
    border-color: #D2042D;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.question {
    font-weight: bold;
    margin-bottom: 10px;
    color: black;
}

.uploaded-question {
    margin-bottom: 10px;
    color: black;
    font-weight: bold;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #D2042D;
}

.selected-answer {
    margin-bottom: 20px;
    padding: 10px;
    background-color: white;
    border-left: 4px solid #ddd;
    margin-left: 10px;
    cursor: pointer;
}

.answer {
    margin-bottom: 10px;
    cursor: pointer;
}

.highlight {
    color: #D2042D;
    font-style: italic;
    font-weight: normal;
}

.similarity-scores {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.similarity-scores span {
    margin-right: 10px;
}

/* Flash message styles */
.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.flash-message.show {
    opacity: 1;
}

/* Download button styles */
.download-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: calc(33.33% - 35px); /* Match the right panel width */
    padding: 12px;
    background-color: #D2042D;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.download-button:hover {
    background-color: #A80326;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* End message styles */
.end-message {
    text-align: center;
    padding: 15px;
    color: #666;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    #search-container {
        flex-direction: column;
    }

    .left-column, .right-column {
        flex: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .right-column {
        max-height: 50vh;
        margin-bottom: 80px;
    }

    .download-button {
        width: calc(100% - 40px);
    }

    .large-upload-icon {
        width: 96px;
        height: 96px;
    }

    .upload-text {
        font-size: 16px;
    }

    .flash-message {
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .upload-container {
        max-width: 90%;
        margin: 20px auto;
    }

    .search-box-container input {
        font-size: 14px;
    }

    .search-box-container .upload-icon {
        width: 28px;
        height: 28px;
    }

    .large-upload-icon {
        width: 72px;
        height: 72px;
    }

    .upload-text {
        font-size: 14px;
    }
}