/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

:root {
    --bg-color: #000040; /* Deeper than standard royal blue */
    --text-color: #7FFF00; /* Chartreuse */
    --line-color: #404040; /* Gray lines */
    --navbar-width: 200px; /* Fixed width instead of percentage */
    --navbar-bg: rgba(0, 0, 32, 0.95);
}

/* Light mode variables */
body.light-mode {
    --bg-color: #F5F5F5; /* Very light gray, near white */
    --text-color: #2D5016; /* Dark green for readability */
    --line-color: #D0D0D0; /* Light gray lines */
    --navbar-bg: rgba(255, 255, 255, 0.95);
}

/* Light mode specific overrides */
body.light-mode .command-input {
    color: #000000; /* Black text for input field */
    background: rgba(255, 255, 255, 0.8); /* Light white background */
    padding: 8px;
    border-radius: 4px;
}

body.light-mode .command-input::placeholder {
    color: #666666; /* Darker gray placeholder */
}

body.light-mode .input-container {
    background: rgba(255, 255, 255, 0.5); /* Lighter background for whole container */
}

/* Keep tooltips with dark background in light mode */
body.light-mode .node-tooltip {
    background: rgba(0, 0, 32, 0.95); /* Dark background */
    border-color: #404040;
}

body.light-mode .field-name {
    color: #FFFFFF; /* Keep white labels */
}

body.light-mode .field-value {
    color: #7FFF00; /* Keep chartreuse values */
}

body.light-mode .tooltip-definition {
    color: #A0A0A0; /* Keep gray definition text */
}

/* Light mode tree windows */
body.light-mode .tree-wrapper {
    background: rgba(255, 255, 255, 0.6); /* Light white background for tree windows */
}

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Navbar */
.navbar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--navbar-width);
    background: var(--navbar-bg);
    border-right: 1px solid var(--line-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.navbar.hidden {
    transform: translateX(-100%);
}

.navbar-toggle {
    position: fixed;
    left: 10px;
    top: 20px;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    display: none;  /* Hidden by default */
    transition: opacity 0.3s ease;
}

/* Show hamburger only when navbar is hidden */
.navbar-toggle.show {
    display: block;
}

.navbar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.navbar-toggle span:last-child {
    margin-bottom: 0;
}

.navbar.hidden .navbar-toggle span:nth-child(1) {
    transform: rotate(0deg);
}

.navbar.hidden .navbar-toggle span:nth-child(2) {
    opacity: 1;
}

.navbar.hidden .navbar-toggle span:nth-child(3) {
    transform: rotate(0deg);
}

.navbar-close {
    position: absolute;
    right: 10px;
    top: 20px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: 102;
}

.navbar-close:hover {
    transform: translateX(-3px);
}

.navbar-content {
    padding: 80px 20px 20px;
    height: 100%;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-label {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.6;
}

.nav-button {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    white-space: normal;  /* Allow text wrapping */
    word-wrap: break-word;  /* Break long words if needed */
    transition: all 0.2s ease;
}

.nav-button.example-btn {
    font-size: 13px;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

/* Login Container */
.login-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99;
}

/* Login Button */
.login-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-btn:hover {
    background: rgba(127, 255, 0, 0.1);
    transform: scale(1.05);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn.authenticated {
    border: 2px solid #FFFFFF;
}

.login-text {
    display: block;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
}

.user-avatar:not(.hidden) {
    display: block;
}

.user-avatar:not(.hidden) + .login-text,
.login-text.hidden {
    display: none;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--navbar-bg);
    border: 1px solid var(--line-color);
    border-radius: 4px;
    overflow: hidden;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.profile-dropdown:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(127, 255, 0, 0.1);
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--line-color);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin-left: var(--navbar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.navbar.hidden ~ .main-content {
    margin-left: 0;
}

/* Trees Container */
.trees-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-height: 0; /* Enable proper flex scrolling */
}

/* Input Wrapper - Fixed at bottom */
.input-wrapper {
    position: sticky;
    bottom: 0;
    background: var(--bg-color);
    border-top: 1px solid var(--line-color);
    padding: 20px;
    display: flex;
    justify-content: center;
    z-index: 50;
}

/* Command Input */
.input-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    border: 1px solid var(--line-color);
    padding: 12px 16px;
    background: rgba(0, 0, 32, 0.5);
    transition: all 0.3s ease;
}

.input-container.processing {
    border-color: var(--text-color);
    animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(127, 255, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(127, 255, 0, 0.3);
    }
}

.prompt {
    color: var(--text-color);
    font-size: 18px;
    margin-right: 10px;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.3;
    }
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 18px;
    caret-color: var(--text-color);
}

.command-input::placeholder {
    color: #808080;  /* Light gray */
    opacity: 0.7;
}

/* Tree Visualization Styles */
.tree-wrapper {
    border: 1px solid var(--line-color);
    border-radius: 4px;
    padding: 20px;
    margin: 10px 0;
    background: rgba(0, 0, 32, 0.3);
    position: relative;
    min-height: 600px; /* Increased to accommodate logic boxes with extended padding */
}

/* Original sentence text */
.tree-sentence {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: var(--text-color);
    font-size: 14px;
    font-style: italic;
    opacity: 0.7;
    max-width: 70%;
}

/* Debug button (top-right corner, only when ?debug=true) */
.debug-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(0, 0, 32, 0.8);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    border-radius: 4px;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.debug-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.tree-svg {
    width: 100%;
    min-height: 300px;
    background: transparent;
}

.tree-node {
    cursor: pointer;
}

.tree-node rect {
    fill: #000000;  /* Black background for nodes */
    stroke-width: 2;
    transition: all 0.2s ease;
    pointer-events: all;  /* Ensure rect captures all mouse events */
}

.tree-node.verb rect { stroke: #FF0000; }
.tree-node.noun rect { stroke: #0080FF; }
.tree-node.modifier rect { stroke: #FFFF00; }
.tree-node.mark rect { stroke: #00FF00; }
.tree-node.other rect { stroke: #808080; }

.tree-node text {
    font-family: inherit;
    font-size: 18px;  /* Increased from 14px */
    text-anchor: middle;
    dominant-baseline: middle;
    transition: all 0.2s ease;
    pointer-events: none;  /* Allow hover events to pass through to rect */
}

.tree-node.verb text { fill: #FF0000; }
.tree-node.noun text { fill: #0080FF; }
.tree-node.modifier text { fill: #FFFF00; }
.tree-node.mark text { fill: #00FF00; }
.tree-node.other text { fill: #808080; }

.tree-node:hover rect {
    filter: drop-shadow(0 0 8px currentColor);
    stroke-width: 3;
}

/* Special styling for Wikipedia-linked nodes */
.tree-node[style*="cursor: pointer"] rect {
    stroke-dasharray: 3 2;
}

.tree-node[style*="cursor: pointer"]:hover rect {
    stroke-dasharray: none;
    fill: rgba(127, 255, 0, 0.1);
}

.tree-link {
    fill: none;
    stroke-width: 2;
    opacity: 0.8;
}

.tree-link.agent { stroke: #FFA500; }
.tree-link.patient { stroke: #87CEEB; }
.tree-link.combinator { stroke: #808080; }
.tree-link.theme { stroke: #90EE90; }
.tree-link.location { stroke: #DDA0DD; }
.tree-link.other { stroke: #606060; }

/* Loading Animation */
.loading-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    display: none; /* Hidden by default */
}

.loading-animation:not(.hidden) {
    display: flex; /* Only show when hidden class is removed */
}

.tree-loader {
    position: relative;
    width: 100px;
    height: 120px;
}

/* Tree trunk */
.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 40px;
    background: var(--text-color);
    animation: grow-up 1s ease-out infinite;
}

/* Tree branches forming */
.tree-branch {
    position: absolute;
    background: var(--text-color);
    transform-origin: bottom center;
}

.tree-branch-1 {
    bottom: 30px;
    left: 50%;
    width: 3px;
    height: 25px;
    --rotation: -30deg;
    transform: translateX(-50%) rotate(-30deg);
    animation: branch-grow 1.5s ease-in-out infinite;
}

.tree-branch-2 {
    bottom: 30px;
    left: 50%;
    width: 3px;
    height: 25px;
    --rotation: 30deg;
    transform: translateX(-50%) rotate(30deg);
    animation: branch-grow 1.5s 0.2s ease-in-out infinite;
}

.tree-branch-3 {
    bottom: 50px;
    left: 50%;
    width: 3px;
    height: 20px;
    --rotation: -45deg;
    transform: translateX(-50%) rotate(-45deg);
    animation: branch-grow 1.5s 0.4s ease-in-out infinite;
}

.tree-branch-4 {
    bottom: 50px;
    left: 50%;
    width: 3px;
    height: 20px;
    --rotation: 45deg;
    transform: translateX(-50%) rotate(45deg);
    animation: branch-grow 1.5s 0.6s ease-in-out infinite;
}

.tree-branch-5 {
    bottom: 40px;
    left: 50%;
    width: 3px;
    height: 22px;
    --rotation: -20deg;
    transform: translateX(-50%) rotate(-20deg);
    animation: branch-grow 1.5s 0.3s ease-in-out infinite;
}

.tree-branch-6 {
    bottom: 40px;
    left: 50%;
    width: 3px;
    height: 22px;
    --rotation: 20deg;
    transform: translateX(-50%) rotate(20deg);
    animation: branch-grow 1.5s 0.5s ease-in-out infinite;
}

.tree-branch-7 {
    bottom: 60px;
    left: 50%;
    width: 3px;
    height: 18px;
    --rotation: -35deg;
    transform: translateX(-50%) rotate(-35deg);
    animation: branch-grow 1.5s 0.7s ease-in-out infinite;
}

.tree-branch-8 {
    bottom: 60px;
    left: 50%;
    width: 3px;
    height: 18px;
    --rotation: 35deg;
    transform: translateX(-50%) rotate(35deg);
    animation: branch-grow 1.5s 0.8s ease-in-out infinite;
}

/* Leaves appearing */
.tree-leaf {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--text-color);
    border-radius: 50%;
    opacity: 0;
}

.tree-leaf-1 {
    top: 35px;
    left: 20px;
    animation: leaf-appear 2s 0.8s ease-in-out infinite;
}

.tree-leaf-2 {
    top: 40px;
    right: 20px;
    animation: leaf-appear 2s 1s ease-in-out infinite;
}

.tree-leaf-3 {
    top: 50px;
    left: 15px;
    animation: leaf-appear 2s 1.2s ease-in-out infinite;
}

.tree-leaf-4 {
    top: 55px;
    right: 15px;
    animation: leaf-appear 2s 1.4s ease-in-out infinite;
}

.tree-leaf-5 {
    top: 30px;
    left: 25px;
    animation: leaf-appear 2s 0.9s ease-in-out infinite;
}

.tree-leaf-6 {
    top: 33px;
    right: 25px;
    animation: leaf-appear 2s 1.1s ease-in-out infinite;
}

.tree-leaf-7 {
    top: 43px;
    left: 10px;
    animation: leaf-appear 2s 1.3s ease-in-out infinite;
}

.tree-leaf-8 {
    top: 47px;
    right: 10px;
    animation: leaf-appear 2s 1.5s ease-in-out infinite;
}

.tree-leaf-9 {
    top: 37px;
    left: 30px;
    animation: leaf-appear 2s 1.0s ease-in-out infinite;
}

.tree-leaf-10 {
    top: 45px;
    right: 28px;
    animation: leaf-appear 2s 1.6s ease-in-out infinite;
}

/* Additional top middle leaves */
.tree-leaf-11 {
    top: 25px;
    left: 50%;
    margin-left: -4px;
    animation: leaf-appear 2s 0.7s ease-in-out infinite;
}

.tree-leaf-12 {
    top: 20px;
    left: 50%;
    margin-left: -12px;
    animation: leaf-appear 2s 1.0s ease-in-out infinite;
}

.tree-leaf-13 {
    top: 20px;
    left: 50%;
    margin-left: 4px;
    animation: leaf-appear 2s 1.2s ease-in-out infinite;
}

.tree-leaf-14 {
    top: 15px;
    left: 50%;
    margin-left: -4px;
    animation: leaf-appear 2s 1.4s ease-in-out infinite;
}

.tree-leaf-15 {
    top: 10px;
    left: 50%;
    margin-left: -4px;
    animation: leaf-appear 2s 0.8s ease-in-out infinite;
}

@keyframes grow-up {
    0%, 100% {
        height: 40px;
        opacity: 0.3;
    }
    50% {
        height: 45px;
        opacity: 1;
    }
}

@keyframes branch-grow {
    0%, 100% {
        transform: translateX(-50%) rotate(var(--rotation, -30deg)) scaleY(0.5);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) rotate(var(--rotation, -30deg)) scaleY(1);
        opacity: 1;
    }
}

@keyframes leaf-appear {
    0%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    75% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Node Tooltip */
.node-tooltip {
    position: absolute;
    background: var(--navbar-bg);
    border: 1px solid var(--line-color);
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    color: var(--text-color);
    pointer-events: auto;  /* Allow clicking links */
    display: none;  /* Hidden by default for better performance */
    z-index: 200;
    min-width: 150px;
    max-width: 400px;
    width: fit-content;  /* Changed from max-content to fit-content */
}

.node-tooltip.visible {
    display: block;  /* Show instantly without animation */
}

.tooltip-field {
    display: flex;
    margin-bottom: 8px;
    gap: 12px;  /* Reduced gap */
    align-items: flex-start;  /* Align items at the start */
}

.field-name {
    font-weight: bold;
    color: #FFFFFF;  /* Changed from yellow to white */
    flex-shrink: 0;
    min-width: 60px;  /* Consistent label width */
}

.field-value {
    color: var(--text-color);
    text-align: left;  /* Changed from right to left */
    word-break: break-word;  /* Allow long words to break */
}

.tooltip-definition {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-color);
    font-style: italic;
    color: #A0A0A0;
    line-height: 1.4;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--line-color);
}

/* Performance optimizations */
.navbar,
.navbar-toggle,
.login-btn {
    will-change: transform;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    :root {
        --navbar-width: 250px; /* Slightly wider on mobile for touch targets */
    }
    
    .main-content {
        padding: 0 5%;
    }
    
    .command-input,
    .prompt {
        font-size: 16px;
    }
}
/* Debug Mode Styles */
.debug-container {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--line-color);
    padding: 10px 20px;
}

.debug-container.hidden {
    display: none;
}

.debug-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.debug-tab {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--line-color);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.debug-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.debug-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.debug-panels {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    max-height: 300px;
    overflow: auto;
}

.debug-panel {
    display: none;
    padding: 15px;
}

.debug-panel.active {
    display: block;
}

.debug-panel pre {
    margin: 0;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
}

/* Pronoun highlighting in debug mode */
.pronoun-highlight {
    background: rgba(255, 255, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 0, 0.4);
}

.pronoun-pointer {
    color: #4CAF50;
    font-weight: bold;
}

/* Blinking animation for pointer targets */
@keyframes pointer-target-blink {
    0% { fill: #000000; stroke-width: 2; }
    25% { fill: #FF6B6B; stroke: #FF6B6B; stroke-width: 4; }
    50% { fill: #000000; stroke-width: 2; }
    75% { fill: #FF6B6B; stroke: #FF6B6B; stroke-width: 4; }
    100% { fill: #000000; stroke-width: 2; }
}

.tree-node rect.pointer-target-blink {
    animation: pointer-target-blink 1.5s infinite !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--navbar-bg);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.modal-close:hover {
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(114, 220, 56, 0.3);
    color: var(--green-accent);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(114, 220, 56, 0.1);
    border-color: var(--green-accent);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-content h2 {
    margin-bottom: 16px;
    font-size: 1.3em;
}

/* Billing Modal Specifics */
.billing-modal {
    max-width: 450px;
}

.billing-info {
    margin-bottom: 16px;
    line-height: 1.5;
}

.billing-status {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 16px;
}

.billing-status p {
    margin-bottom: 8px;
}

.billing-status p:last-child {
    margin-bottom: 0;
}

.billing-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Credits Balance Display */
.credits-balance {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 16px;
}

.balance-amount,
.balance-words {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.balance-amount {
    border-bottom: 1px solid rgba(127, 255, 0, 0.2);
}

.balance-label {
    color: rgba(127, 255, 0, 0.7);
}

.balance-value {
    font-size: 1.2em;
    font-weight: bold;
}

/* Auto-reload Section */
.auto-reload-section {
    margin-bottom: 16px;
}

.auto-reload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

.auto-reload-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auto-reload-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
}

.auto-reload-status.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.auto-reload-status.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.auto-reload-status.pending {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Light mode auto-reload status */
body.light-mode .auto-reload-status.error {
    color: #721c24;
}

body.light-mode .auto-reload-status.warning {
    color: #856404;
}

body.light-mode .auto-reload-status.pending {
    color: #0c5460;
}

/* Light mode credits balance */
body.light-mode .credits-balance {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .balance-amount {
    border-bottom-color: rgba(45, 80, 22, 0.2);
}

body.light-mode .balance-label {
    color: rgba(45, 80, 22, 0.7);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    transition: opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(127, 255, 0, 0.1);
}

/* Light mode modal adjustments */
body.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .billing-status {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .btn-primary {
    background: #2D5016;
    color: #FFFFFF;
}

body.light-mode .btn-secondary {
    border-color: #2D5016;
    color: #2D5016;
}

body.light-mode .btn-secondary:hover:not(:disabled) {
    background: rgba(45, 80, 22, 0.1);
}

/* API Keys Modal */
.api-keys-modal {
    max-width: 1000px;
}

/* API Keys Table */
.api-keys-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.api-keys-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line-color);
    font-weight: bold;
    font-size: 0.85em;
    color: rgba(127, 255, 0, 0.7);
}

.api-keys-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(127, 255, 0, 0.1);
    vertical-align: middle;
}

.api-keys-table tbody tr:hover {
    background: rgba(127, 255, 0, 0.05);
}

.key-name-cell {
    font-weight: bold;
    white-space: nowrap;
}

.key-value-cell code {
    font-size: 0.85em;
    color: rgba(127, 255, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    word-break: break-all;
}

.key-usage-cell {
    text-align: right;
    white-space: nowrap;
    color: rgba(127, 255, 0, 0.8);
}

.key-copy-cell {
    width: 40px;
    text-align: center;
}

.api-key-copy {
    background: transparent;
    border: 1px solid var(--line-color);
    color: var(--text-color);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.7;
}

.api-key-copy:hover {
    opacity: 1;
    border-color: var(--text-color);
}

.api-key-copy.copied {
    border-color: #4CAF50;
    color: #4CAF50;
    opacity: 1;
}

.key-curl-cell {
    width: 50px;
    text-align: center;
}

.api-key-curl {
    background: transparent;
    border: 1px solid var(--line-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75em;
    transition: all 0.2s;
    opacity: 0.7;
}

.api-key-curl:hover {
    opacity: 1;
    border-color: var(--text-color);
}

.api-key-curl.copied {
    border-color: #4CAF50;
    color: #4CAF50;
    opacity: 1;
}

.key-action-cell {
    width: 40px;
    text-align: center;
}

.api-key-delete {
    background: transparent;
    border: 1px solid #ff6666;
    color: #ff6666;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    transition: all 0.2s;
}

.api-key-delete:hover {
    background: #ff6666;
    color: var(--bg-color);
}

.api-keys-create {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.api-keys-create input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line-color);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9em;
}

.api-keys-create input::placeholder {
    color: rgba(127, 255, 0, 0.5);
}

.api-keys-create input:focus {
    outline: none;
    border-color: var(--text-color);
}

.api-keys-count {
    font-size: 0.85em;
    color: rgba(127, 255, 0, 0.6);
    text-align: right;
}

.no-keys {
    text-align: center;
    color: rgba(127, 255, 0, 0.6);
    padding: 2rem 0;
}

#api-keys-no-billing {
    text-align: center;
    padding: 2rem 0;
}

#api-keys-no-billing a {
    color: var(--text-color);
    text-decoration: underline;
}

#api-keys-no-billing a:hover {
    opacity: 0.8;
}

/* Light mode API keys adjustments */
body.light-mode .api-keys-table thead th {
    color: rgba(45, 80, 22, 0.7);
}

body.light-mode .api-keys-table tbody td {
    border-bottom-color: rgba(45, 80, 22, 0.1);
}

body.light-mode .api-keys-table tbody tr:hover {
    background: rgba(45, 80, 22, 0.05);
}

body.light-mode .key-value-cell code {
    color: #2D5016;
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .key-usage-cell {
    color: rgba(45, 80, 22, 0.8);
}

body.light-mode .api-keys-create input {
    background: rgba(0, 0, 0, 0.05);
    color: #2D5016;
}

body.light-mode .api-keys-create input::placeholder {
    color: rgba(45, 80, 22, 0.5);
}

body.light-mode .api-keys-count {
    color: rgba(45, 80, 22, 0.6);
}

body.light-mode .no-keys {
    color: rgba(45, 80, 22, 0.6);
}

body.light-mode #api-keys-no-billing a {
    color: #2D5016;
}
