:root {
    --bg-color: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --text-color: #1e293b;
    --accent-color: #0d9488;
    /* Teal/Petrol accent */
    --border-color: #e2e8f0;
    --sidebar-bg: linear-gradient(180deg, #083344 0%, #0d9488 100%);
    /* Petrol gradient */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hidden {
    display: none !important;
}

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    display: flex;
}


#app {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

#sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
    line-height: 1.2;
}

.sidebar-content {
    flex: 1;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    /* Increased top padding */
    overflow-y: auto;
}

.sidebar-controls {
    margin-bottom: 2rem;
}

.filter-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white !important;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.filter-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.filter-group {
    margin-bottom: 2rem;
}

/* Sidebar Sections */
details.filter-group {
    border-bottom: 1px solid var(--border-color);
}

summary {
    list-style: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
}

.summary-text {
    line-height: 1.2;
}


summary::-webkit-details-marker {
    display: none;
}

summary:hover {
    background-color: var(--hover-color);
    color: var(--text-primary);
}

summary::after {
    content: '❯';
    /* Arrow */
    font-size: 0.75rem;
    transition: transform 0.2s;
}


details[open] summary::after {
    transform: rotate(90deg);
}

.filter-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-item input {
    margin-right: 0.75rem;
    width: 1rem;
    height: 1rem;
    accent-color: white;
}

.filter-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    border: 1px solid white;
    /* Thin white border as requested */
    box-shadow: 0 0 0 1px #cbd5e1;
    /* Subtle shadow for depth */
}

/* Sidebar Elements (New Classes) */
.sidebar-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 100%;
    color: #333;
    font-size: 0.85em;
    /* Default/Base size */
    margin-bottom: 8px;
}

.sidebar-label-text {
    font-size: 0.9em;
    /* Default/Base size */
    margin-right: 10px;
}

.cluster-btn {
    background: white;
    color: var(--accent-color);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    font-weight: 700;
    font-size: 0.8rem;
    /* Increased size */
    transition: background 0.2s, opacity 0.2s;
}

.cluster-btn:hover {
    opacity: 0.9;
}

.cluster-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    margin-top: 5px;
}

.cluster-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Toggle Button */
#sidebar-toggle {
    position: absolute;
    left: 280px;
    top: 20px;
    background: #083344;
    color: white;
    border: none;
    padding: 0.5rem 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 0 0.5rem 0.5rem 0;
    cursor: pointer;
    z-index: 101;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

#sidebar.collapsed+#sidebar-toggle {
    left: 0;
}

/* Main Content Area */
main {
    flex: 1;
    position: relative;
    display: flex;
    height: 100%;
    background-color: var(--bg-color);
}

#cy {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Details Panel Overhaul */
#details-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 450px;
    /* Increased from 320px */
    background-color: var(--panel-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 20;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out, opacity 0.3s;
}

#details-panel.hidden {
    transform: translateX(500px);
    /* Adjusted for wider panel */
    opacity: 0;
}

#details-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

#panel-scroll-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 5px;
    /* prevent scrollbar from hitting content */
}

#details-content {
    flex: 0 0 auto;
    /* Don't grow, take natural height */
    font-size: 0.875rem;
}

.detail-item {
    margin-bottom: 1rem;
}

.detail-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.detail-value {
    color: var(--text-color);
    overflow-wrap: break-word;
    /* Break words only if needed */
    hyphens: auto;
    /* Hyphenate long words */
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

#close-details {
    margin-top: 1rem;
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#close-details:hover {
    opacity: 0.9;
}

/* Feature Screenshots Styling */
#bot-selector-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

#bot-selector {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

#screenshot-container {
    margin-top: 1.5rem;
}

/* Old screenshot styles removed to prevent duplicates */

/* Responsive Design */

/* Large Screens */
@media (min-width: 1600px) {
    .sidebar-select {
        font-size: 0.95em;
    }

    .sidebar-label-text {
        font-size: 1em;
    }

    .cluster-btn {
        font-size: 1.0em;
    }
}

/* Small Laptops */
@media (max-width: 1366px) {
    .sidebar-header h1 {
        font-size: 1.1rem;
    }

    .filter-section-title {
        font-size: 0.65rem;
        margin-bottom: 0.75rem;
    }

    .sidebar-content {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    /* Auto-adjust details panel on small screens */
    #details-panel {
        width: 350px;
    }
}

/* Screenshot Navigation Button */
.screenshot-outer-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    /* Reduced gap */
    justify-content: center;
    margin-top: 1rem;
}

.screenshot-wrapper {
    position: relative;
    /* Removed flex: 1 to prevent stretching */
    /* Removed background and border to avoid "frame" look */
    display: flex;
    align-items: center;
    justify-content: center;
}

#feature-screenshot {
    max-height: 500px;
    /* Adjusted to 500px as requested */
    width: auto;
    max-width: 100%;
    border-radius: 0.5rem;
    /* Apply radius to image */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    /* Shadow for lift */
    border: 1px solid var(--border-color);
    /* Subtle border on image */
}

.screenshot-nav-btn {
    position: static;
    background: transparent;
    /* Cleaner look */
    color: var(--text-color);
    border: 1px solid transparent;
    /* Invisible border by default */
    font-size: 0.8rem;
    /* Even smaller font */
    width: 20px;
    /* Even smaller size */
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    /* Only animate color */
    flex-shrink: 0;
    opacity: 0.5;
}

.screenshot-nav-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    /* Show border on hover */
    background: rgba(255, 255, 255, 0.5);
    /* Subtle bg */
    opacity: 1;
}

.screenshot-nav-btn:active {
    transform: scale(0.95);
}

.screenshot-nav-btn.hidden {
    display: none !important;
}

/* Custom Checkbox Colors */
.purple-checkbox {
    accent-color: #CC79A7;
}

/* Ensure filter items align well */
.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #e2e8f0;
    margin-bottom: 5px;
}

/* Disabled state for filters during clustering */
.disabled-filters {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* --- Tutorial Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.media-container {
    height: 250px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tutorial-placeholder {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border: 2px dashed #94a3b8;
}

.content-area {
    padding: 24px 32px 10px 32px;
    text-align: center;
}

.content-area h2 {
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.content-area p {
    color: #64748b;
    line-height: 1.6;
    font-size: 1rem;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s, transform 0.2s;
}

.step-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.navigation-footer {
    padding: 16px 32px 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
}

.tutorial-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.tutorial-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tutorial-btn.secondary {
    background: transparent;
    color: #64748b;
}

.tutorial-btn.secondary:hover {
    color: var(--text-color);
    background: #f1f5f9;
}