body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f7;
    min-height: 100vh;
}
  
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-section {
    display: flex;
    justify-content: center;
    padding: 5px 0;
}

h1 {
    text-align: center;
    color: #1d1d1f;
    margin: 0 0 10px 0;
    font-size: 1.8em;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    gap: 8px;
}

.mode-button {
    padding: 6px 16px;
    font-size: 14px;
    border: 1px solid #d1d1d1;
    background-color: #f1f1f1;
    color: #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.mode-button:hover {
    background-color: #e3e3e3;
    transform: translateY(-1px);
    box-shadow: 0 3px 5px rgba(0,0,0,0.15);
}

.mode-button.active {
    background-color: rgb(168, 28, 52);
    color: white;
    border-color: rgb(148, 18, 42);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

.mode-button.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(255,255,255,0.5);
}

.mode-button.active::before {
    content: "✓ ";
    opacity: 0.9;
}

.mode-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 28, 52, 0.3), 0 2px 3px rgba(0,0,0,0.1);
}

.mode-button.active:focus {
    box-shadow: 0 0 0 2px rgba(168, 28, 52, 0.3), 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Setup Panel Styling */
.setup-panel {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setup-instructions {
    text-align: center;
    color: #666;
    font-size: 1em;
    padding-bottom: 15px;
    border-bottom: 1px solid #e6e6e6;
}

.concentration-setup {
    display: flex;
    gap: 20px;
    padding-top: 5px;
}

/* Query Section Styling */
.query-section {
    display: flex;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e6e6;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    align-items: center;
}

#queryInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#queryInput::placeholder {
    color: #86868b;
    font-size: 0.9em;
}

#queryInput:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.1);
    outline: none;
}

/* Results Area Styling */
.results-area {
    opacity: 1;
    transition: all 0.2s ease;
    margin: 10px 0;
}

.results-area.hidden {
    display: none;
    opacity: 0;
    margin: 0;
    height: 0;
    overflow: hidden;
}

.results-area.loading {
    opacity: 0.7;
}

.summary-section {
    background: white;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6e6e6;
}

.summary-section h2 {
    color: #1d1d1f;
    margin: 0 0 12px 0;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: -0.2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.summary-content {
    font-size: 0.95em;
    line-height: 1.5;
}

/* Summary content HTML formatting */
.summary-content ul,
.summary-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.summary-content li {
    margin-bottom: 6px;
}

.summary-content p {
    margin: 8px 0;
}

.summary-content strong {
    font-weight: 600;
    color: #1d1d1f;
}

.summary-content em {
    font-style: italic;
    color: #1d1d1f;
}

.summary-content h3,
.summary-content h4 {
    margin: 15px 0 8px 0;
    color: #1d1d1f;
}

.summary-content h3 {
    font-size: 1.1em;
    font-weight: 600;
}

.summary-content h4 {
    font-size: 1em;
    font-weight: 600;
}

/* Placeholder text (initial state) */
.placeholder-text {
    text-align: center;
    padding: 20px 15px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.placeholder-text i {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 3px;
}

.placeholder-text p {
    margin: 0;
    font-size: 0.95em;
}

.placeholder-hint {
    font-size: 0.85em !important;
    opacity: 0.8;
}

/* Concentration Columns */
.concentration-column {
    flex: 1;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.2s ease;
}

.handbook-main-heading {
    width: 100%;
    color: #1d1d1f;
    font-size: 1.2em;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.handbook-main-heading.hidden {
    display: none;
}

.concentration-column.concentration-a {
    border-top: 3px solid rgb(168, 28, 52);
}

.concentration-column.concentration-b {
    border-top: 3px solid rgb(43, 65, 110);
}

/* Form Section Styling */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-section label {
    color: #1d1d1f;
    font-weight: 500;
    font-size: 0.95em;
}

.handbook-heading {
    font-size: 1.1em;
    color: #666;
    margin: 25px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1d1d1;
    font-weight: 600;
}

select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 30px;
}

select:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.1);
    outline: none;
}

button {
    padding: 8px 16px;
    background-color: #444;
    color: white;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
}

button:hover {
    background-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 28, 52, 0.3), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* Default button style for other buttons (not query or mode buttons) */
button:not(#queryBtn):not(.mode-button) {
    background: linear-gradient(to bottom, #505050, #404040);
}

button:not(#queryBtn):not(.mode-button):hover {
    background: linear-gradient(to bottom, #606060, #505050);
}

button:not(#queryBtn):not(.mode-button):active {
    background: #404040;
}

#queryBtn {
    white-space: nowrap;
    background: linear-gradient(to bottom, rgb(178, 38, 62), rgb(168, 28, 52));
    border: 1px solid rgb(148, 18, 42);
    color: white;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
}

#queryBtn:hover {
    background: linear-gradient(to bottom, rgb(188, 48, 72), rgb(178, 38, 62));
}

#queryBtn:active {
    background: rgb(168, 28, 52);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.section-nav {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e6e6e6;
    max-height: 400px;
    overflow-y: auto;
}

.section-nav .section {
    color: #1d1d1f;
    font-size: 13px;
    margin-bottom: 3px;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-nav .section.has-content {
    cursor: pointer;
}

.section-nav .section.has-content:hover {
    color: #0071e3;
    background-color: #f5f5f7;
}

.section-nav .section.no-content {
    color: #86868b;
    font-weight: 400;
    cursor: default;
    font-style: italic;
}

.section-nav .section.no-content:hover {
    background-color: transparent;
}

.section-nav .section.active {
    color: #000000;
    font-weight: 500;
    background-color: #f5f5f7;
}

.section-nav .section .caret {
    color: #86868b;
    margin-left: 8px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.section-nav .section.has-content:hover .caret {
    opacity: 1;
    color: #0071e3;
}

.section-nav .section.expanded .caret {
    transform: rotate(90deg);
}

.section-content {
    display: none;
    padding: 10px;
    margin: 5px 0;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e6e6e6;
    font-size: 13px;
}

.section-content.visible {
    display: block;
}

/* Enhanced Markdown content styling */
.section-content h1 {
    font-size: 20px;
    margin-top: 0;
    text-align: left;
}

.section-content h2 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e6e6e6;
}

.section-content h3 {
    font-size: 16px;
    margin-top: 15px;
}

/* List styling */
.section-content ul, 
.section-content ol {
    padding-left: 24px;
    margin: 12px 0;
}

.section-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Nested list styling */
.section-content li > ul,
.section-content li > ol {
    margin: 8px 0 8px 16px;
}

/* Special handling for lettered lists */
.section-content ol {
    list-style-type: lower-alpha;
}

.section-content ol ol {
    list-style-type: decimal;
}

/* Handle dash/hyphen lists */
.section-content ul li {
    position: relative;
}

.section-content ul li:before {
    content: "•";
    position: absolute;
    left: -18px;
    color: #666;
}

/* Handle dash/hyphen lists specifically */
.section-content ul li[data-bullet="–"]:before {
    content: "–";
}

/* Markdown content styling */
.section-content p {
    margin: 10px 0;
}

.section-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.section-content th, .section-content td {
    border: 1px solid #d1d1d1;
    padding: 8px;
    text-align: left;
}

.section-content th {
    background-color: #f5f5f7;
}

.section-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 15px;
    color: #666;
    font-style: italic;
    background: linear-gradient(90deg, #f5f5f7 25%, #e5e5e7 50%, #f5f5f7 75%);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s infinite;
    border-radius: 3px;
    font-size: 0.9em;
    margin: 10px 0;
}

@keyframes loading-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* References styling */
.references {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e6e6e6;
}

.references h3 {
    margin: 0 0 12px 0;
    color: #1d1d1f;
    font-size: 1.1em;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.references ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.references li {
    margin-bottom: 12px;
}

.reference-quote {
    padding: 12px 15px;
    margin: 6px 0;
    border-radius: 3px;
    font-style: italic;
    line-height: 1.4;
    position: relative;
    transition: transform 0.2s ease;
    font-size: 0.9em;
}

.reference-quote:hover {
    transform: translateX(4px);
}

.reference-quote::before {
    content: '"';
    font-size: 24px;
    position: absolute;
    left: 6px;
    top: 0;
    opacity: 0.3;
}

.reference-quote.concentration-a {
    background-color: rgba(168, 28, 52, 0.05);
    border-left: 3px solid rgb(168, 28, 52);
}

.reference-quote.concentration-b {
    background-color: rgba(43, 65, 110, 0.05);
    border-left: 3px solid rgb(43, 65, 110);
}

.reference-header {
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.concentration-label {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 500;
}

.concentration-label.concentration-a {
    background-color: rgba(168, 28, 52, 0.1);
    color: rgb(168, 28, 52);
}

.concentration-label.concentration-b {
    background-color: rgba(43, 65, 110, 0.1);
    color: rgb(43, 65, 110);
}

.section-name {
    font-size: 0.8em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0.9;
}

.section-name.concentration-a {
    color: rgb(168, 28, 52);
    background-color: rgba(168, 28, 52, 0.1);
}

.section-name.concentration-b {
    color: rgb(43, 65, 110);
    background-color: rgba(43, 65, 110, 0.1);
}

.error-message {
    color: #d44950;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    font-size: 1em;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .concentration-setup {
        flex-direction: column;
    }
    
    .query-section {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}

/* Humanities Toggle */
.humanities-toggle {
    font-size: 0.8em;
    white-space: nowrap;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #aaa !important;
    font-weight: 400;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.checkbox-label:hover {
    opacity: 0.9;
}

.checkbox-label input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
    margin: 0;
    opacity: 0.6;
}

.checkbox-label input[type="checkbox"]:checked {
    opacity: 0.85;
}

/* Override any other label styles */
.form-section-header .checkbox-label {
    color: #aaa !important;
    font-weight: 400;
}

/* Example Query Buttons Styling */
.example-queries {
    border-bottom: 1px solid #e6e6e6;
    padding-bottom: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.example-queries-header {
    margin: 0;
    flex-shrink: 0;
}

.example-queries-title {
    font-size: 0.8em;
    color: #666;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.example-buttons-container {
    flex: 1;
    min-width: 0;
}

.example-buttons {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
}

.example-buttons.active {
    display: flex;
}

button.example-button {
    background: #ffffff !important;
    border: 1px solid #d1d1d6 !important;
    color: #1d1d1f !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 270px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none !important;
}

button.example-button i {
    font-size: 10px;
    opacity: 0.7;
    color: #86868b;
}

button.example-button:hover {
    background: #f1f1f4 !important;
    border-color: #a1a1a6 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    color: #000000 !important;
}

button.example-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    background: #e8e8ed !important;
}

button.example-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 28, 52, 0.2), 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* Make example buttons responsive */
@media (max-width: 768px) {
    .example-queries {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .example-buttons {
        width: 100%;
    }
    
    .example-button {
        max-width: none;
        justify-content: flex-start;
        text-align: left;
        flex: 1;
        min-width: 0;
    }
}
  