/* 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-tertiary: #94a3b8;
    --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;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --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-tertiary: #64748b;
    --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;
    --warning-bg: #451a03;
    --warning-text: #fcd34d;
    --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: relative;
    /* Now lives inside the navbar right area */
    top: 0;
    right: 0;
    z-index: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    bring toggle closer to copy button
}

/* 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 {
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0;
    /* Rounded on right side only */
    padding: 0.5rem 0.75rem;
    /* Match collection-button padding */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    /* Match collection-button line-height */
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.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);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    cursor: pointer;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px 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: none;
    /* stretch full width so right side can be fully right */
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* no forced symmetry */
    align-items: center;
    /* Symmetric outer margins */
    padding: 0.8rem 1.2rem;
    /* gap: 2rem; */
    position: relative;
    /* anchor for absolute-centered nav */
}

.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: 1rem;
    align-items: center;
    justify-content: center;
    position: absolute;
    /* center to viewport, independent of side widths */
    left: 50%;
    transform: translateX(-50%);
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-separator {
    width: 2px;
    height: 24px;
    background: var(--text-secondary);
    margin: 0 0.75rem;
    opacity: 0.3;
    border-radius: 1px;
    position: relative;
}

.nav-separator::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--text-secondary), transparent);
    opacity: 0.2;
    border-radius: 2px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: transparent;
}

.nav-link:hover {
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.nav-link .nav-icon {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: baseline;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link.active {
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

/* Dark mode adjustments */
[data-theme="dark"] .nav-separator {
    background: var(--text-secondary);
    opacity: 0.4;
}

[data-theme="dark"] .nav-separator::before {
    background: linear-gradient(to right, transparent, var(--text-secondary), transparent);
    opacity: 0.3;
}

/* Responsive navigation */
@media (max-width: 768px) {
    .nav-menu {
        gap: 0.5rem;
    }

    .nav-separator {
        display: none;
    }

    .nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .nav-link span {
        display: none;
    }

    .nav-link .nav-icon {
        font-size: 1rem;
    }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0;
    justify-self: end;
}

.collection-dropdown {
    position: relative;
    min-width: 280px;
}

.collection-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    /* Rounded on left side only */
    border-right: 1px solid var(--text-muted);
    /* Add separator line */
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    min-width: 280px;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Ensure collection-button and copy-link have identical heights */
.nav-user .collection-button,
.nav-user .copy-link-btn {
    height: 40px;
    /* unified control height */
}

.collection-button:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

.collection-button.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

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

.collection-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.collection-name {
    color: var(--text-muted);
    font-style: italic;
    max-width: 25ch;
    /* Truncate only after 25 characters */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.collection-button.active .collection-arrow {
    transform: rotate(180deg);
}

.collection-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow-color);
    width: 100%;
    min-width: 280px;
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.collection-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.collection-info {
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.collection-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    padding: 0;
}

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

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    font-size: 0.875rem;
}

.info-value {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.copy-id-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

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

.collection-actions {
    padding: 0.25rem;
    background: var(--bg-primary);
}

.dropdown-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 0;
}

.dropdown-action:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

.dropdown-action i {
    width: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.dropdown-action:hover i {
    color: var(--accent-color);
}

.dropdown-action:last-child {
    border-bottom: none;
}

.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;
}

.ensure-min-height {
    min-height: calc(100vh - 80px);
    /* Account for fixed navbar height */
}

.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;
    display: flex;
    flex-direction: column;
}

.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);
}

/* Config section copy buttons */
.config-header .copy-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    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;
}

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

.config-header .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;
    /* Adjusted margin-bottom */
    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 {
    margin-top: auto;
    /* Push instructions to the bottom of the flex container */
}

.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;
}

/* Dashboard Section */
.dashboard-content {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    align-items: center;
    /* Align items vertically in the middle */
    position: relative;
    /* For absolute positioning of the save button */
}

.dashboard-buttons-left {
    display: flex;
    gap: 1rem;
}

#save-order-btn {
    position: absolute;
    right: 0;
    margin-right: 0rem;
    /* Align precisely with the right edge */
    top: 50%;
    transform: translateY(-50%);
    /* Vertically center */
    /* Add transition for hover effect */
    transition: all 0.3s ease;
}

#save-order-btn:hover {
    border-color: var(--success-color);
    color: var(--success-color);
}

.flex-spacer {
    flex-grow: 1;
}

/* Section transitions */
.section {
    scroll-margin-top: 80px;
    /* Account for fixed navbar */
}

/* Specific adjustments for the setup section */
.setup-section {
    min-height: auto;
    /* Allow height to be content-driven */
    padding-bottom: 0.5rem;
    /* Reduce bottom padding for this section */
}

/* Visual separation between sections */
.section:not(#home) {
    position: relative;
    padding-top: 6rem;
}

/* Add separator line that doesn't interfere with scroll positioning */
.section:not(#home)::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    height: 1px;
    background: var(--border-color);
    max-width: 1200px;
    /* Match container max-width */
}

/* 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);
}

/* Specialized buttons for prompt types */
.btn-prompt {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: #3b82f6;
    color: white;
    border: 1px solid transparent;
}

.btn-prompt:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-workflow {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: #10b981;
    color: white;
    border: 1px solid transparent;
}

.btn-workflow:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.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 {
    /* Remove background and border since prompts-container handles styling */
}

.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);
}

/* Wider modal for workflow editing */
#workflow-modal .modal-content {
    max-width: 900px;
    width: 95%;
}

/* Workflow view toggle */
.workflow-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

/* Diagram view styles */
.workflow-diagram-view {
    height: 520px;
    /* Fixed height to match YAML view */
    display: flex;
    flex-direction: column;
}

.diagram-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
}

.zoom-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.zoom-level {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 3rem;
    text-align: center;
}

.workflow-diagram-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    flex: 1;
    /* Take remaining space */
    overflow: auto;
    /* Enable scrollbars when content exceeds container */
    position: relative;
    max-height: 450px;
    /* Ensure container doesn't exceed modal bounds */
}

.workflow-diagram-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transform-origin: center center;
    transition: transform 0.2s ease;
    min-width: 100%;
    min-height: 100%;
}

/* YAML view styles - ensure same height as diagram view */
.workflow-yaml-view {
    height: 520px;
    /* Fixed height to match diagram view */
    display: flex;
    flex-direction: column;
}

.workflow-yaml-view .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workflow-yaml-view .yaml-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workflow-yaml-view .yaml-editor {
    flex: 1;
    resize: none;
    /* Prevent manual resizing */
}

/* Mermaid diagram styling */
.workflow-diagram-content svg {
    display: block;
    margin: 0 auto;
}

/* Ensure scrollbars are visible when needed */
.workflow-diagram-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.workflow-diagram-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

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

.workflow-diagram-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}

/* Dark mode adjustments for diagram containers */
[data-theme="dark"] .workflow-diagram-container,
[data-theme="dark"] .enlarged-diagram-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .workflow-view-toggle {
    background: var(--bg-tertiary);
}

/* Diagram error styling */
.diagram-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
    min-height: 200px;
}

.diagram-error i {
    font-size: 2rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}

.diagram-error p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    color: var(--text-primary);
}

.diagram-error small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Responsive adjustments for workflow modal */
@media (max-width: 768px) {
    #workflow-modal .modal-content {
        width: 98%;
        max-width: none;
        margin: 1rem;
    }

    .workflow-view-toggle {
        flex-direction: column;
        gap: 0.25rem;
    }

    .toggle-btn {
        padding: 0.75rem 1rem;
    }

    .diagram-controls {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .workflow-diagram-container {
        height: 300px;
    }

    .zoom-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .zoom-level {
        min-width: 3.5rem;
    }
}

/* Ensure diagrams don't overflow containers */
.workflow-diagram-content svg,
.enlarged-diagram-content svg {
    max-width: 100% !important;
    height: auto !important;
}

/* Smooth zoom transitions */
.workflow-diagram-content,
.enlarged-diagram-content {
    transition: transform 0.2s ease-in-out;
}

/* Prevent text selection during zoom operations */
.workflow-diagram-content.zooming,
.enlarged-diagram-content.zooming {
    user-select: none;
}

/* Drag-to-pan cursor styles */
.workflow-diagram-container {
    cursor: grab;
    cursor: -webkit-grab;
    cursor: -moz-grab;
}

.workflow-diagram-container:active,
.workflow-diagram-container.dragging {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    cursor: -moz-grabbing;
}

/* Prevent text selection during dragging */
.workflow-diagram-container.dragging,
.workflow-diagram-container.dragging * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Smooth scrolling for better drag experience */
.workflow-diagram-container {
    scroll-behavior: auto;
    /* Disable smooth scrolling during drag */
}

pointer-events: none;
}

/* Improve zoom control accessibility */
.zoom-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

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

/* Better visual feedback for zoom controls */
.zoom-controls:hover .zoom-btn {
    background: var(--bg-tertiary);
}

.zoom-controls .zoom-btn:hover {
    background: var(--accent-color);
    color: white;
}

.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);
}

/* Disabled/readonly input styling */
.form-group input[readonly] {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.form-group input[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

/* Special styling for readonly name field */
.form-group input.readonly-field {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
    font-weight: 500;
    position: relative;
}

.form-group input.readonly-field:focus {
    box-shadow: none;
}

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

/* Enhanced YAML Editor Styling */
.yaml-editor-container,
.textarea-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary);
    margin: 0;
}

.yaml-editor {
    width: 100%;
    min-height: 400px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    padding: 1rem;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary);
    resize: vertical;
    tab-size: 2;
    -moz-tab-size: 2;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    font-weight: 400;
    letter-spacing: 0.025em;
    margin: 0 !important;
    box-shadow: none !important;
    display: block;
}

.yaml-editor:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.yaml-editor-container:focus-within,
.textarea-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Copy button styling for textarea and yaml editor containers */
.textarea-container .copy-btn,
.yaml-editor-container .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.textarea-container .copy-btn:hover,
.yaml-editor-container .copy-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.textarea-container .copy-btn:active,
.yaml-editor-container .copy-btn:active {
    transform: translateY(0);
}

.textarea-container .copy-btn.copied,
.yaml-editor-container .copy-btn.copied {
    background: var(--accent-color) !important;
    color: white !important;
    transform: scale(0.95);
}

.textarea-container .copy-btn i,
.yaml-editor-container .copy-btn i {
    font-size: 11px;
}

/* Ensure textarea has proper padding to avoid overlap with copy button */
.textarea-container textarea {
    padding-right: 45px;
    border: none;
    background: transparent;
    resize: vertical;
    width: 100%;
}

.yaml-editor-container .yaml-editor {
    padding-right: 45px;
}

/* Remove border and background from textareas inside containers */
.textarea-container textarea:focus,
.yaml-editor-container .yaml-editor:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.yaml-editor::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Override any inherited form styles */
.form-group .yaml-editor {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.form-group .yaml-editor:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Dark mode adjustments */
[data-theme="dark"] .yaml-editor-container,
[data-theme="dark"] .textarea-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .textarea-container .copy-btn,
[data-theme="dark"] .yaml-editor-container .copy-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .textarea-container .copy-btn:hover,
[data-theme="dark"] .yaml-editor-container .copy-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-color);
}

[data-theme="dark"] .yaml-editor {
    background: transparent !important;
    color: var(--text-primary);
}

.workflow-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.workflow-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.workflow-info i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

/* Prompt type icons */
.prompt-type-icon {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.workflow-icon {
    color: #10b981;
    /* Green for workflows */
}

.prompt-icon {
    color: #3b82f6;
    /* Blue for regular prompts */
}

.prompt-name-text {
    flex: 1;
    min-width: 0;
    /* Allow text to truncate if needed */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Optional: Add subtle background colors for different prompt types */
.workflow-prompt {
    background: rgba(16, 185, 129, 0.02);
}

.regular-prompt {
    background: rgba(59, 130, 246, 0.02);
}

/* Dark mode adjustments */
[data-theme="dark"] .workflow-prompt {
    background: rgba(16, 185, 129, 0.05);
}

[data-theme="dark"] .regular-prompt {
    background: rgba(59, 130, 246, 0.05);
}



.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;
        display: flex;
        justify-content: space-between;
    }

    .nav-menu {
        display: none;
    }

    .collection-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 8px 0 0 8px;
        border-right: 1px solid var(--border-color);
        min-width: 200px;
    }

    .copy-link-btn {
        border-radius: 0 8px 8px 0;
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }

    .nav-user {
        margin-right: 0.75rem;
        /* Small gap before theme toggle on mobile */
        justify-self: auto;
    }

    .collection-label {
        display: none;
    }

    .collection-name-display-nav {
        display: none;
    }

    .collection-dropdown-menu {
        min-width: 200px;
        right: -1rem;
    }

    .collection-info {
        padding: 0.75rem;
    }

    .collection-actions {
        padding: 0.25rem;
    }

    .dropdown-action {
        padding: 0.625rem;
        font-size: 0.8rem;
    }

    .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;
    }

    .config-header .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;
}

.collection-button.not-set {
    border-color: var(--error-color);
    animation: pulse-red 1.5s infinite;
}

.collection-button.not-set .collection-id {
    color: var(--error-color);
    font-weight: 600;
}

@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);
    }
}

/* Enhanced Prompts List Styles */
.prompts-container {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 60px;
    /* Ensure minimum height for drop zone */
    position: relative;
}

/* Add padding to top and bottom for better drop zones */
.prompts-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    z-index: 1;
    transition: background-color 0.2s ease;
}

.prompts-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    z-index: 1;
    transition: background-color 0.2s ease;
}

/* Show drop zone hints when dragging */
.prompts-container.drag-active::before {
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.1), transparent);
}

.prompts-container.drag-active::after {
    background: linear-gradient(to top, rgba(59, 130, 246, 0.1), transparent);
}

.prompt-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.prompt-item:last-child {
    border-bottom: none;
}

.prompt-item:hover {
    background: var(--bg-secondary);
    padding: 1.25rem 1.5rem 1.25rem 1.5rem;
    /* Maintain consistent padding to prevent height change */
}

.prompt-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background-color 0.15s ease, width 0.15s ease;
    /* Add transition for width property */
}

.prompt-item:hover::before {
    background: var(--accent-color);
    width: 3px;
    /* Make the border thinner */
}

.prompt-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.prompt-icon i {
    font-size: 1.1rem;
}

.workflow-icon {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.regular-prompt-icon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.prompt-item:hover .prompt-icon {
    transform: scale(1.05);
}

.prompt-content {
    flex: 1;
    min-width: 0;
}

.prompt-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    font-size: 1rem;
    line-height: 1.2;
}

.prompt-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.prompt-actions {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

/* Drag and Drop Styles */
.prompt-item.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent-color);
    background: var(--bg-secondary);
    transform: rotate(2deg);
    transition: transform 0.1s ease;
}

.prompt-placeholder {
    background: var(--bg-tertiary);
    border: 1px dashed var(--accent-color);
    margin: 0.25rem 0.75rem;
    border-radius: 8px;
    opacity: 0.7;
    transition: all 0.1s ease;
    pointer-events: none;
    position: relative;
    z-index: 2;
}

/* Special styling when placeholder is first child */
.prompt-placeholder:first-child {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Special styling when placeholder is last child */
.prompt-placeholder:last-child {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.prompt-item:hover .prompt-actions {
    opacity: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.05);
}

.delete-btn i {
    font-size: 0.9rem;
}

/* Dark mode enhancements */
[data-theme="dark"] .workflow-icon {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .regular-prompt-icon {
    background: rgba(59, 130, 246, 0.15);
}

/* 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);
}

/* Recent Collections Styles */
.recent-collections {
    margin-bottom: 1.5rem;
}

.recent-collections h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.recent-collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.recent-collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-collection-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.recent-collection-info {
    flex: 1;
    min-width: 0;
}

.recent-collection-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-collection-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.recent-collection-time {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.recent-collections-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    text-align: center;
}

.recent-collections-divider::before,
.recent-collections-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.recent-collections-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Settings Modal Styles */
.settings-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.settings-row label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
    margin-bottom: 0;
}

.settings-value-with-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.settings-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
}

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

.copy-id-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

.clone-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.clone-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clone-info i {
    color: var(--accent-color);
}

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

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 250px;
    max-width: 350px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

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

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

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

.toast-warning {
    border-left: 4px solid var(--warning-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;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    cursor: help;
}

/* New Modal Specific Styles */
.clone-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.clone-info i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.settings-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-row label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.settings-value-with-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.settings-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    flex: 1;
}

/* Recent Collections Styles */
.recent-collections {
    margin-bottom: 1.5rem;
}

.recent-collections h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.recent-collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.recent-collection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-collection-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.recent-collection-info {
    flex: 1;
    min-width: 0;
}

.recent-collection-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-collection-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-collection-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.recent-collections-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    text-align: center;
}

.recent-collections-divider::before,
.recent-collections-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.recent-collections-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-primary);
}

/ * Lock indicators and disabled states */ .lock-icon {
    color: var(--text-tertiary);
    margin-left: 8px;
    font-size: 0.8em;
    opacity: 0.7;
}

.readonly-field {
    background-color: var(--input-disabled-bg) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

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

.disabled-locked:hover {
    background-color: var(--btn-secondary-bg) !important;
}

.settings-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.lock-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-lock {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-lock:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-lock:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.lock-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lock-info-icon {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.lock-info-text {
    line-height: 1.3;
}

/* Collection info row for lock status */
.collection-info-row {
    display: flex;
    align-items: center;
}

.collection-info-row .lock-icon {
    margin-left: 4px;
    margin-right: 0;
}

/* Recent collection lock icon styling */
.recent-collection-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-collection-lock-icon {
    color: var(--text-tertiary);
    font-size: 0.75em;
    opacity: 0.6;
    flex-shrink: 0;
}

/* Collection locked message */
.collection-locked-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin: 0;
}

.collection-locked-message i {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.collection-locked-message a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.collection-locked-message a:hover {
    text-decoration: underline;
}

/* Responsive design for lock action row */
@media (max-width: 480px) {
    .lock-action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-lock {
        width: 100%;
        justify-content: center;
    }

    .lock-info {
        align-self: stretch;
        justify-content: center;
    }
}
