/* CSS Variables for Theme Support */
:root {
    /* Light Theme Colors - Subtle Sky Blue */
    --bg-primary: #f0f8ff;
    --bg-secondary: #e6f3ff;
    --bg-tertiary: #d1e9ff;
    --text-primary: #1e3a5f;
    --text-secondary: #4a6fa5;
    --text-muted: #7ba3d1;
    --border-color: #b8d4f1;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --gradient-start: #60a5fa;
    --gradient-end: #a78bfa;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.35;
    background:
        radial-gradient(circle at 20% 20%, #60a5fa 2px, transparent 2px),
        radial-gradient(circle at 80% 60%, #60a5fa 2px, transparent 2px),
        radial-gradient(circle at 40% 80%, #60a5fa 2px, transparent 2px),
        radial-gradient(circle at 60% 30%, #60a5fa 2px, transparent 2px),
        radial-gradient(circle at 90% 90%, #60a5fa 2px, transparent 2px),
        radial-gradient(circle at 10% 70%, #60a5fa 2px, transparent 2px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px, 220px 220px, 280px 280px;
    animation: starTwinkle 8s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    height: 200%;
    z-index: -1;
    opacity: 0.15;
    background:
        linear-gradient(180deg, transparent 0%, transparent 45%, #7ba3d1 50%, transparent 55%, transparent 100%);
    background-size: 100% 4px;
    animation: meteorFall 15s linear infinite;
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(1.2);
    }
}

@keyframes meteorFall {
    0% {
        transform: translateY(-100px);
    }
    100% {
        transform: translateY(calc(100vh + 100px));
    }
}

/* Enhanced falling effect for larger screens */
@media (min-width: 1200px) {
    body::before {
        background-size: 300px 300px, 400px 400px, 350px 350px, 250px 250px, 320px 320px, 380px 380px;
    }
}

/* Theme Toggle Slider */
.theme-toggle {
    position: fixed;
    top: 1rem; /* Adjusted to align with navbar padding */
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hide the checkbox input */
.theme-slider {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* The slider track */
.slider {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    background-color: var(--border-color);
    border-radius: 34px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.slider:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* Slider thumb */
.slider::before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 4px;
    top: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.theme-slider:checked + .slider {
    background-color: var(--accent-color);
}

.theme-slider:checked + .slider::before {
    transform: translateX(26px);
}

/* Slider icons container */
.slider-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.slider-icons i {
    font-size: 14px;
    transition: opacity 0.3s ease;
    z-index: 1;
    /* Perfect vertical centering */
    position: absolute;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon visibility based on theme */
[data-theme="light"] .slider-icons .fa-sun,
:root .slider-icons .fa-sun {
    opacity: 1;
    color: var(--accent-color);
    left: 17px;
    top: 9px;
    transform: translateX(-50%);
}

[data-theme="light"] .slider-icons .fa-moon,
:root .slider-icons .fa-moon {
    opacity: 0.3;
    color: var(--text-muted);
    left: 43px;
    top: 9px;
    transform: translateX(-50%);
}

[data-theme="dark"] .slider-icons .fa-moon {
    opacity: 1;
    color: var(--accent-color);
    left: 43px;
    top: 9px;
    transform: translateX(-50%);
}

[data-theme="dark"] .slider-icons .fa-sun {
    opacity: 0.3;
    color: var(--text-muted);
    left: 17px;
    top: 9px;
    transform: translateX(-50%);
}

/* Focus state for accessibility */
.theme-slider:focus + .slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.copy-link-btn {
    position: fixed;
    top: 1rem;
    right: 90px; /* Adjust this value to position it next to the theme toggle */
    z-index: 1000;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%; /* Make it round */
    width: 34px; /* Same width as theme toggle slider */
    height: 34px; /* Same height as theme toggle slider */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.copy-link-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-grow: 1; /* Allow it to take up available space */
    justify-content: center; /* Center its content */
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-start);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-id-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.user-id {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-family: monospace;
}

/* Main Content */
.main-content {
    margin-top: 80px;
}

.section {
    padding: 4rem 0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1rem;
}

.hero-image-placeholder {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hero-logo {
    width: 80%;
    height: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.hero-logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

/* Features Section */
.features {
    padding: 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--accent-color);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 1.5rem;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Agent Selector Styles */
.agent-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.agent-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agent-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.agent-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.agent-btn.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Configuration Section */
.config-content {
    max-width: 800px;
    margin: 0 auto;
}

.config-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.config-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 88px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.config-code {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.config-notice {
    background: var(--bg-tertiary);
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.config-info-pane {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.info-pane-icon {
    color: var(--accent-color);
    font-size: 1.8rem;
    line-height: 1;
}

.info-pane-content p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.5;
}

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

.notice-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.notice-content i {
    color: var(--warning-color);
    font-size: 1.125rem;
}

.notice-content span {
    font-size: 0.875rem;
    line-height: 1.4;
}

.config-instructions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.instruction-list {
    list-style: none;
    padding: 0;
}

.instruction-list li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.instruction-list li:last-child {
    border-bottom: none;
}

.instruction-list code {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Prompts Section */
.prompts-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.text-button {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.text-button:hover {
    background: var(--bg-tertiary);
    text-decoration: underline;
}

.text-button.delete-prompt {
    color: var(--error-color);
}

.text-button.delete-prompt:hover {
    background: rgba(239, 68, 68, 0.1);
}

.prompts-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem 2rem; /* Existing padding */
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    min-height: 120px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-cancel:hover {
    background: var(--bg-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-menu {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .config-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .copy-btn {
        align-self: center;
    }

    .prompts-controls {
        flex-direction: column;
        align-items: center;
    }

    .container {
        padding: 0 1rem;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
    }

    .slider {
        width: 50px;
        height: 28px;
    }

    .slider::before {
        height: 20px;
        width: 20px;
        left: 4px;
        top: 4px;
    }

    .theme-slider:checked + .slider::before {
        transform: translateX(22px);
    }

    .slider-icons i {
        font-size: 12px;
        /* Perfect vertical centering for mobile */
        position: absolute;
        width: 14px;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    [data-theme="light"] .slider-icons .fa-sun,
    :root .slider-icons .fa-sun {
        top: 7px;
        left: 13px;
        transform: translateX(-50%);
    }

    [data-theme="light"] .slider-icons .fa-moon,
    :root .slider-icons .fa-moon {
        top: 7px;
        left: 37px;
        transform: translateX(-50%);
    }

    [data-theme="dark"] .slider-icons .fa-moon {
        top: 7px;
        left: 37px;
        transform: translateX(-50%);
    }

    [data-theme="dark"] .slider-icons .fa-sun {
        top: 7px;
        left: 13px;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-logo {
        width: 70%;
        max-width: 300px;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .config-instructions,
    .prompts-list {
        padding: 1.5rem;
    }
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* UUID Modal Styles */
.collection-info-display {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.collection-property {
    margin-bottom: 0.5rem; /* Reduced space between properties */
}

.collection-property:last-child {
    margin-bottom: 0;
}

.collection-property label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem; /* Reduced space below label */
    color: var(--text-primary);
}

.collection-property .collection-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    padding: 0.5rem; /* Reduced padding */
    border-radius: 6px;
    border: 1px solid var(--border-color);
    word-break: break-all;
    color: var(--text-secondary);
    display: block; /* Ensure it takes full width */
}

#uuid-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Enhanced modal footer for UUID modal */
#uuid-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

#uuid-modal .modal-footer .btn-secondary {
    flex: 1;
    min-width: 140px;
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

#uuid-modal .modal-footer .btn-primary {
    flex: 1;
    min-width: 160px;
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

/* Tabbed Interface Styles */
.tab-container {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--bg-primary);
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    font-weight: 600;
}

.tab-pane {
    padding: 1.5rem;
    display: none;
    background: var(--bg-primary);
}

.tab-pane.active {
    display: block;
}

.validation-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem; /* Reserve space to prevent layout shift */
}

/* Adjust modal footer styles for forms within tabs */
#set-id-pane .modal-footer,
#create-new-pane .modal-footer {
    padding: 0; /* Remove padding from inner modal-footer */
    border-top: none; /* Remove border from inner modal-footer */
    margin-top: 1.5rem; /* Add space above buttons */
    justify-content: flex-end; /* Align buttons to the right */
}

#create-new-pane .modal-footer {
    justify-content: space-between; /* For generate button on left */
}

#set-id-pane .modal-footer .btn-primary,
#create-new-pane .modal-footer .btn-primary,
#create-new-pane .modal-footer .btn-secondary {
    flex: unset; /* Reset flex property */
    min-width: unset; /* Reset min-width */
    width: auto; /* Allow buttons to size naturally */
}

/* Responsive adjustments for UUID modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }

    #uuid-modal .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    #uuid-modal .modal-footer button {
        width: 100%;
        min-width: unset;
    }
}

.user-id.not-set {
    color: var(--error-color);
    font-weight: 600;
    border: 1px solid var(--error-color);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Prompts Table Styles */
.prompts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0; /* Removed unwanted space above the header */
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 2rem;
}

.prompts-table thead {
    background: var(--bg-secondary);
}

.prompts-table th {
    padding: 0.5rem 1.5rem;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.prompts-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: top;
}

.prompts-table tbody tr:last-child td {
    border-bottom: none;
}

.prompt-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.prompt-row:hover {
    background-color: var(--bg-secondary);
}

.prompts-table td pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60px;
    overflow: hidden;
}

.prompts-table .prompt-actions {
    white-space: nowrap;
}

/* Define a light version of accent-color for selected rows */
:root {
    --accent-color-light: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] {
    --accent-color-light: rgba(96, 165, 250, 0.1);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(0);
    min-width: 250px;
    max-width: 350px;
    border: 1px solid var(--border-color);
}

.toast.hide {
    opacity: 0;
    transform: translateY(20px);
}

.toast-success {
    border-left: 5px solid var(--success-color);
}

.toast-error {
    border-left: 5px solid var(--error-color);
}

.toast-info {
    border-left: 5px solid var(--accent-color);
}


.collection-value-with-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-property .collection-value {
    flex-grow: 1; /* Allow the value to take up available space */
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    padding: 0.5rem; /* Reduced padding */
    border-radius: 6px;
    border: 1px solid var(--border-color);
    word-break: break-all;
    color: var(--text-secondary);
    display: block; /* Ensure it takes full width */
}

.copy-id-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative; /* For tooltip positioning */
}

.copy-id-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* Tooltip styles */
.copy-id-button[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.copy-id-button[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%) translateY(5px); /* Arrow below tooltip */
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-primary) transparent transparent transparent;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.copy-id-button[data-tooltip]:hover::before,
.copy-id-button[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.path-instruction {
    font-size: 0.8em; /* Make it smaller relative to its parent */
    font-weight: normal; /* Override bold from h3 */
    color: var(--text-secondary); /* A slightly muted color */
}

.collection-name-display-nav {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}