:root {
    --z-background: 1;
    --z-content: 10;
    --z-header: 50;  /* Verhoogd van 20 naar 50 */
    --z-mobile-menu: 100;
}

/* Particle effects */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

/* Layout & positioning */
.content-wrapper {
    position: relative;
    z-index: var(--z-content);
    margin-top: 0; /* Voeg dit toe als er overlap problemen zijn */
}

/* Glass effect elements */
.glass-effect {
    background-color: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(55, 65, 81, 0.5);
    position: relative;
}

.glass-dark {
    background-color: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(8px);
}

/* Glow effects */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4F46E5, #7C3AED);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-effect:hover::before {
    opacity: 0.5;
}

/* Gradient text */
.gradient-text {
    background-image: linear-gradient(to right, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Button effects */
.gradient-button {
    background-image: linear-gradient(to right, rgba(37, 99, 235, 0.8), rgba(124, 58, 237, 0.8));
    color: white;
    font-weight: 500;
    transition: all 0.2s;
}

.gradient-button:hover {
    background-image: linear-gradient(to right, rgb(37, 99, 235), rgb(124, 58, 237));
}

/* Card hover effects */
.hover-card {
    transition: all 0.3s;
}

.hover-card:hover {
    transform: scale(1.05);
}

/* Custom animations */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Base styles - forcing dark theme */
body {
    background-color: rgb(17, 24, 39);
    color: rgb(243, 244, 246);
}

button {
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

input, textarea {
    background-color: rgba(17, 24, 39, 0.5);
    color: rgb(243, 244, 246);
    resize: vertical; /* Allow vertical resizing */
}

/* Output box styles */
.output-box {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: #f3f4f6;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    text-align: left; /* Align text to the left */
}

.output-box p {
    text-align: left; /* Ensure paragraphs are aligned to the left */
}

.output-box .mjx-chtml {
    text-align: left !important; /* Ensure MathJax content is aligned to the left */
}

.output-box .mjx-chtml .mjx-math {
    display: inline-block; /* Ensure inline display for MathJax content */
}




.MathJax {
    text-align: left !important;
    margin-left: 0 !important;
}
mjx-container[jax="CHTML"][display="true"] {
    margin: 1.5em 0 !important;
    text-align: left !important;
    padding-left: 1rem !important;
}
.output-box {
    line-height: 1.6;
}
.output-box > div {
    max-width: 100%;
    overflow-x: auto;
}

/* Custom select styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233B82F6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Modern Toggle Switch Styling */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.toggle-switch {
    position: relative;
    width: 250px; /* Increased width */
    height: 48px; /* Increased height to match button */
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.1), 
        rgba(139, 92, 246, 0.1), 
        rgba(59, 130, 246, 0.1));
    background-size: 200% 200%;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.1),
                inset 0 2px 4px rgba(255, 255, 255, 0.1),
                inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    user-select: none;
}

.toggle-switch:hover {
    transform: translateY(-1px);
    animation: gradient-shift 3s ease infinite;
    box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.3),
                0 5px 15px -5px rgba(139, 92, 246, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.2),
                inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch:active {
    transform: translateY(0px);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 4px);
    height: calc(100% - 4px);
    background: linear-gradient(90deg,
        rgba(59, 130, 246, 0.9), 
        rgba(139, 92, 246, 0.9),
        rgba(59, 130, 246, 0.9));
    background-size: 200% 200%;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    will-change: transform;
    transform: translateX(0);
    z-index: 1;
}

.toggle-switch[data-active="gpt-4"] .toggle-slider {
    transform: translateX(calc(100% + 4px));
}

.toggle-switch:hover .toggle-slider {
    animation: gradient-shift 3s ease infinite;
    box-shadow: 0 4px 15px -1px rgba(59, 130, 246, 0.3),
                0 2px 10px -1px rgba(139, 92, 246, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* Enhance the hover state */
.toggle-switch:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.2),
                0 5px 15px -5px rgba(139, 92, 246, 0.1),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Updated solve button styles */
#submit {
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.9), 
        rgba(139, 92, 246, 0.9), 
        rgba(59, 130, 246, 0.9));
    background-size: 200% 200%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.1),
                inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

#submit:hover {
    transform: translateY(-1px);
    animation: gradient-shift 3s ease infinite;
    box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.3),
                0 5px 15px -5px rgba(139, 92, 246, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

#submit:active {
    transform: translateY(0px);
}

/* Updated label styles for better visibility */
.toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* Enhanced hover state for inactive labels */
.toggle-switch[data-active="gpt-3.5-turbo"] .toggle-label:last-child:hover,
.toggle-switch[data-active="gpt-4"] .toggle-label:first-child:hover {
    color: rgba(255, 255, 255, 0.8);
}

.toggle-switch[data-active="gpt-3.5-turbo"] .toggle-label:first-child,
.toggle-switch[data-active="gpt-4"] .toggle-label:last-child {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Prevent text selection during toggle */
.toggle-labels {
    user-select: none;
    position: relative;
    display: flex;
    height: 100%;
    z-index: 2;
    padding: 0 5px; /* Increased padding */
}

.toggle-label {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 5px;
}

.toggle-label:first-child {
    justify-content: flex-start;
    padding-right: 15px; /* Push 'Fast' more to the left */
}

.toggle-label:last-child {
    justify-content: flex-end;
    padding-left: 15px; /* Push 'Accurate' more to the right */
}

.toggle-label span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.model-name {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: normal;
    letter-spacing: 0;
}

.toggle-label span {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Remove absolute positioning that was causing overlay */
.toggle-label:first-child span {
    transform: none;
}

.toggle-label:last-child span {
    transform: none;
}

.toggle-icon {
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 6px 0px;
    position: relative;
}

.toggle-label-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 24px;
    line-height: 24px;
    width: 100%; /* Add this */
    text-align: center; /* Add this */
}

.model-name {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: normal;
    line-height: 1;
    margin-top: 4px;
    text-align: center; /* Add this */
    width: 100%; /* Add this */
}

/* Adjust specific alignment for each side */
.toggle-label:first-child .toggle-label-main {
    justify-content: flex-start;
    transform: translateX(12px); /* Fine tune this value */
}

.toggle-label:first-child .model-name {
    transform: translateX(0px); /* Match with toggle-label-main */
}

.toggle-label:last-child .toggle-label-main {
    justify-content: flex-end;
}

/* Updated container layout */
.flex.items-center.justify-between.gap-4 {
    align-items: flex-end;  /* Align items to bottom */
}

/* Remove margin bottom from label */
.flex.flex-col.gap-2 {
    margin-bottom: 0;
}

/* Label layout fixes */
.toggle-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 15px;
    height: 100%;
    z-index: 2;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 6px 0px;
    position: relative; /* Add this */
    top: 0; /* Add this */
}

.toggle-label:first-child {
    transform: translateY(-2px); /* Fine-tune this value as needed */
}

.toggle-label-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    height: 24px;
    line-height: 24px;
    position: relative; /* Add this */
}

.model-name {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: normal;
    line-height: 1;
    margin-top: 4px;
}

.toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px; /* Match main text height */
    width: 24px;
}

/* Update model name positioning */
.model-name {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: normal;
    margin-top: 2px;
}

/* Adjust label positioning */
.toggle-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    height: 100%;
    z-index: 2;
}

#mobile-menu {
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    width: 300px;
    right: 0;
    height: 100%;
    position: fixed;
    top: 0;
    z-index: calc(var(--z-mobile-menu) + 1);
}

#mobile-menu:not(.hidden) {
    transform: translateX(0);
}

#mobile-menu .mobile-nav-link {
    color: #f3f4f6;
    padding: 0.75rem 2rem;
    width: 100%;
    transition: all 0.2s ease;
}

#mobile-menu .mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

#close-mobile-menu {
    color: #f3f4f6;
    padding: 1rem;
    position: absolute;
    right: 0;
    top: 0;
}

#mobile-menu .flex-col {
    padding: 4rem 0;
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: var(--z-mobile-menu);
}

.mobile-menu-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Update question element z-index */
#question {
    position: relative;
    z-index: 1;
}

/* Z-index hierarchy fixes */
.bg-gradient-blur {
    position: absolute;
    inset: 0; /* Fixed the -inset-[0px] syntax */
    background: linear-gradient(to right, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.2), rgba(37, 99, 235, 0.2));
    filter: blur(120px); /* Fixed the blur property */
    z-index: calc(var(--z-background) + 1);
}

/* Form input styles */
.form-input {
    position: relative;
    z-index: 1;
}

/* Question container */
#question-container {
    position: relative;
    z-index: 2;
}

/* AI Machine Section z-index fixes */
.ai-machine-section {
    position: relative;
    z-index: var(--z-content);
}

.question-input {
    position: relative;
    z-index: var(--z-content);
}

.model-toggle {
    position: relative;
    z-index: var(--z-content);
}

.submit-button {
    position: relative;
    z-index: var(--z-content);
}

/* Gradient blur background */
.bg-gradient-blur {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.2), rgba(37, 99, 235, 0.2));
    filter: blur(120px);
    z-index: calc(var(--z-background) + 1);
    pointer-events: none;
}

/* Mobile menu - blijft hoogste prioriteit */
#mobile-menu {
    z-index: calc(var(--z-mobile-menu) + 1);
}

.mobile-menu-backdrop {
    z-index: var(--z-mobile-menu);
}

/* Z-index hierarchy - Complete rebuild */
:root {
    --z-background: 1;
    --z-content: 10;
    --z-header: 50;  /* Verhoogd van 20 naar 50 */
    --z-mobile-menu: 100;
}

/* Base layers */
#particles-js {
    z-index: var(--z-background);
}

.content-wrapper {
    z-index: var(--z-content);
    margin-top: 0; /* Voeg dit toe als er overlap problemen zijn */
}

/* AI Machine Section */
.ai-machine-section {
    position: relative;
    z-index: 0 !important; /* Force z-index to always be 0 */
}

.question-input,
#submit,
.toggle-switch,
#model-switch,
.toggle-labels {
    position: relative;
    z-index: var(--z-content);
}

/* Mobile menu layers */
.mobile-menu-backdrop {
    position: fixed;
    z-index: var(--z-mobile-menu);
}

#mobile-menu {
    position: fixed;
    z-index: calc(var(--z-mobile-menu) + 1);
}

/* Gradient backgrounds */
.bg-gradient-blur {
    z-index: calc(var(--z-background) + 1);
}

/* Header */
.main-header {
    position: relative;
    z-index: var(--z-header);
}

/* Zorg dat de header-inhoud ook de juiste z-index heeft */
.main-header > * {
    position: relative;
    z-index: inherit;
}

/* When mobile menu is active */
.mobile-menu-active {
    position: relative;
    z-index: var(--z-mobile-menu);
}

/* Particles styling */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content stays above particles */
.content-wrapper, 
main, 
header, 
footer {
    position: relative;
    z-index: 1;
}

/* Dropdown menu styles */
.group:hover .group-hover\:block {
    display: block;
}

.group:hover .group-hover\:translate-y-0 {
    transform: translateY(0);
}

.group-hover\:opacity-100:hover {
    opacity: 1;
}

.group-hover\:visible:hover {
    visibility: visible;
}

/* Add a small delay before menu disappears */
.group > div[class*="absolute"] {
    transition: all 0.3s ease;
    transition-delay: 0.1s;
}

.group:hover > div[class*="absolute"] {
    transition-delay: 0s;
}