/* ==========================================================================
   CSS VARIABLES (Design Tokens)
   ========================================================================== */

:root {
    /* Primary Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;

    /* Background Colors */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;

    /* Glass Effect */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-main: 'Outfit', sans-serif;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
    height: 70px;
}

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

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--primary-color);
}

/* Status Indicator (top-right) */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: background-color 0.3s ease;
}

.status-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* ==========================================================================
   MAIN CONTENT LAYOUT
   ========================================================================== */

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 1rem;
}

/* ==========================================================================
   VIDEO/CANVAS VIEWPORT
   ========================================================================== */

.viewport-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
    border: 1px solid var(--glass-border);
}

.viewport-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    /* Show grab cursor */
    touch-action: none;
    /* Prevent default touch scrolling */
}

.viewport-container:active {
    cursor: grabbing;
}

#video,
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
}

/* ==========================================================================
   OVERLAY STATES (Start Screen, Loading)
   ========================================================================== */

.viewport-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.viewport-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    color: white;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--glass-border);
}

.overlay-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Loading Spinner */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   CONTROL BAR (Slider & Buttons)
   ========================================================================== */

.controls-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Range Slider Styling */
input[type="range"] {
    width: 150px;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Zoom Control - Pill-shaped design for all screen sizes */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 2rem;
    margin-right: 1.5rem;
}

.zoom-control label {
    font-size: 1.25rem;
}

.zoom-control input[type="range"] {
    width: 120px;
}

.zoom-control span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 45px;
}

.control-actions {
    display: flex;
    gap: 0.75rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: none;
    width: 50px;
    /* Increased from 40px */
    height: 50px;
    /* Increased from 40px */
    border-radius: 0.75rem;
    /* Larger radius for larger button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon svg {
    width: 28px;
    height: 28px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: none;
    width: 50px;
    /* Increased from 40px */
    height: 50px;
    /* Increased from 40px */
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger svg {
    width: 28px;
    height: 28px;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* ==========================================================================
   SIDEBAR (Detection Info Panel)
   ========================================================================== */

.info-panel {
    width: 340px;
    /* Increased from 300px */
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    /* Allow scrolling if content is too tall */
}

.panel-header {
    display: flex;
    justify-content: flex-start;
    /* Move badge to left */
    align-items: center;
    gap: 0.75rem;
    /* Add spacing between title and badge */
}

.panel-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Detection List - Compact to fit without scrolling */
.detection-list {
    flex: 1;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: auto;
}

.detection-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid var(--primary-color);
    animation: tooltipFade 0.2s forwards;
}

.fruit-icons[data-tooltip]:hover::after {
    bottom: 100%;
    top: auto;
    transform: translateX(-50%) translateY(-5px);
}

@keyframes tooltipFade {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.item-conf {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
    font-style: italic;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Stats Card (FPS & Latency) - Compact */
.stats-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 0.75rem;
    display: flex;
    justify-content: space-around;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Supported Fruits Info */
/* Supported Fruits Info */
.supported-fruits-info {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Universal spacing */
}

.supported-fruits-info h4 {
    color: var(--text-primary);
    margin-bottom: 0;
    /* Let gap handle spacing */
    font-size: 1.25rem;
    font-weight: 600;
}

.fruit-icons {
    display: flex;
    justify-content: center;
    margin: 0;
    /* Remove auto margins */
}

.fruit-group-img {
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fruit-group-img:hover {
    transform: scale(1.1) rotate(2deg);
}

.header-icon {
    width: 1.25em;
    height: 1.25em;
    vertical-align: text-bottom;
    margin-right: 0.4rem;
    color: var(--primary-color);
}

.future-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    /* Remove auto margins */
    font-weight: 500;
    opacity: 0.9;
}

.tip-box {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ==========================================================================
   FOOTER (Author Attribution)
   ========================================================================== */

.app-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.author-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.author-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.author-link:hover {
    color: var(--primary-color);
}

.future-note a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.future-note a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Camera Flash Effect (for snapshots) */
@keyframes flash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.flash-effect {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 100;
    pointer-events: none;
    animation: flash 0.5s ease-out forwards;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Medium Desktop - 1159px)
   Compact detection list to fit without scrolling
   ========================================================================== */

@media (max-width: 1159px) {

    /* Make detection list fit without scrolling */
    .detection-list {
        overflow-y: visible;
        min-height: auto;
        gap: 0.35rem;
    }

    /* Compact detection items */
    .detection-item {
        padding: 0.5rem 0.75rem;
    }

    .item-name {
        font-size: 0.95rem;
    }

    .item-conf {
        font-size: 0.8rem;
    }

    /* Smaller emoji in compact mode */
    .detection-item .emoji {
        font-size: 1.5rem;
    }

    /* Compact stats card */
    .stats-card {
        padding: 0.75rem;
    }

    .stat-item .label {
        font-size: 0.75rem;
    }

    .stat-item .value {
        font-size: 1rem;
    }

    /* Compact sidebar - keep headings at original size */
    .info-panel {
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Small Desktop - 780px)
   ========================================================================== */

@media (max-width: 780px) {

    /* Stack controls bar vertically on smaller screens */
    .controls-bar {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        padding: 0;
        margin: 0;
    }

    /* Zoom control styling for mobile */
    .zoom-control {
        width: 100%;
        max-width: 280px;
        background: rgba(0, 0, 0, 0.3);
        padding: 0.5rem 1rem;
        border-radius: 2rem;
    }

    .zoom-control input[type="range"] {
        flex: 1;
        width: 100%;
    }

    .control-group {
        justify-content: center;
    }

    .control-actions {
        justify-content: center;
        gap: 0.5rem;
        margin-right: 1.2rem;
    }

    /* Slightly smaller buttons on mobile - Ensure uniform size for all actions */
    .control-actions .btn-icon,
    .control-actions .btn-danger {
        width: 52px;
        height: 52px;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablet/Laptop - 1158px)
   ========================================================================== */

/* Stack main content vertically on screens smaller than 1158px */
@media (max-width: 1158px) {

    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }

    /* Ensure viewport has enough height for overlay content */
    .viewport-container {
        min-height: 70vh;
    }

    /* Sidebar becomes full-width */
    .info-panel {
        width: 100%;
        height: auto;
        min-height: auto;
        padding-bottom: 2rem;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   OPTIMIZED SIDEBAR LAYOUT (Tablet Mode: 516px - 1158px)
   ========================================================================== */
@media (min-width: 516px) and (max-width: 1158px) {
    .info-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    /* Header spans full width */
    .panel-header {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    /* Detections on Left (Top) */
    .detection-list {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        /* height: auto; let it grow based on content or clamp it? */
    }

    /* Stats on Left (Bottom) */
    .stats-card {
        grid-column: 1;
        grid-row: 3;
        margin: 0;
    }

    /* Supported Fruits on Right (Full Height) */
    .supported-fruits-info {
        grid-column: 2;
        grid-row: 2 / span 2;
        margin-top: 0;
        height: 100%;
        /* Fill the column */
        justify-content: flex-start;
        /* Specific to tablet grid layout */
    }

    /* Vertically center the content group (Icon, Note, Tip) between Title and Bottom */
    .supported-fruits-info .fruit-icons {
        margin-top: auto;
    }

    .supported-fruits-info .tip-box {
        margin-bottom: auto;
    }

    .app-footer {
        grid-column: 1 / -1;
        margin-top: 1rem;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile - 768px)
   ========================================================================== */

@media (max-width: 768px) {

    /* Stack main content vertically */
    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }

    /* Sidebar becomes full-width */
    .info-panel {
        width: 100%;
        height: auto;
        min-height: auto;
        padding-bottom: 2rem;
        flex-shrink: 0;
    }

    .stats-card {
        flex-shrink: 0;
        margin-top: auto;
    }

    /* Full-bleed video viewport */
    .viewport-container {
        min-height: 70vh;
        padding: 0;
        border: none;
        background: #000;
    }

    .viewport-wrapper {
        border-radius: 0;
    }

    #video,
    #canvas {
        object-fit: contain;
        /* Show full image without cropping */
    }

    /* Responsive logo */
    .logo h1 {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    /* Stacked controls bar */
    .controls-bar {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        height: auto;
    }

    .control-group {
        justify-content: center;
    }

    .slider-container {
        flex: 1;
        max-width: none;
    }

    .control-actions {
        justify-content: center;
        gap: 0.75rem;
    }

    .btn-icon,
    .btn-danger {
        width: 3rem;
        height: 3rem;
    }

    /* Fixed height detection list */
    .detection-list {
        flex: none;
        height: 200px;
        overflow-y: auto;
        border: none;
        /* Seamless blend */
        border-radius: 0.5rem;
        padding: 0.5rem;
        background: transparent;
        /* Remove background */
    }

    /* Smaller overlay icon */
    .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        margin-bottom: 1rem;
    }
}

/* ==========================================================================
   CUSTOM TOOLTIPS
   ========================================================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f172a;
    color: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-2px);
    }
}

/* ==========================================================================
   SMALL SCREEN ADJUSTMENTS (iPhone SE, Galaxy Fold)
   ========================================================================== */
@media (max-width: 374px) {
    .navbar {
        padding: 0.5rem 1rem;
        height: 60px;
    }

    .logo-icon {
        font-size: 1.25rem;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .status-indicator {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Compact buttons on very small screens */
    .btn-icon,
    .btn-danger {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* ==========================================================================
   FULL SCREEN MODE (Mobile)
   ========================================================================== */

.expand-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: none;
    /* Controlled via JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.expand-btn:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.8);
}

/* Full Screen State overrides */
body.fullscreen-mode {
    overflow: hidden;
}

body.fullscreen-mode .info-panel,
body.fullscreen-mode .controls-bar {
    display: none !important;
}

body.fullscreen-mode .app-container {
    height: 100vh;
    padding: 0;
}

body.fullscreen-mode .viewport-container {
    position: fixed;
    top: 60px;
    /* Leave space for navbar */
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    /* Subtract navbar height */
    z-index: 9999;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    background: black;
}

body.fullscreen-mode .viewport-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

body.fullscreen-mode .expand-btn {
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
}

/* Ensure expand button is hidden on larger screens */
@media (min-width: 551px) {
    .expand-btn {
        display: none !important;
    }

    /* Allow it if already full screen so user can exit */
    body.fullscreen-mode .expand-btn {
        display: flex !important;
    }
}

/* Enlarge Start Screen on larger devices */
@media (min-width: 612px) {
    .overlay-content {
        transform: scale(1.1);
    }

    .icon-circle {
        width: 100px;
        height: 100px;
        margin-bottom: 2rem;
    }

    .overlay-content h2 {
        font-size: 2rem;
    }

    .overlay-content p {
        font-size: 1.1rem;
        max-width: 600px;
        /* Increased to allow single line */
        margin-left: auto;
        margin-right: auto;
    }

    .btn-primary {
        padding: 0.85rem 1.75rem;
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   SIDEBAR TOGGLE (Desktop > 1158px)
   ========================================================================== */
.sidebar-toggle {
    display: none;
}

@media (min-width: 1159px) {
    .main-content {
        position: relative;
        /* Anchor for absolute positioning */
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 20px;
        right: 40px;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        z-index: 50;
        transition: all 0.3s ease;
    }

    .sidebar-toggle:hover {
        color: var(--primary-color);
        transform: scale(1.1);
        background: transparent;
        border: none;
    }

    /* Position inside viewport container if needed, but here it's main-content relative */
    /* When sidebar is collapsed, we might want to move it or keep it anchored */

    /* Transition for smooth collapse */
    .info-panel {
        transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            padding 0.4s ease,
            margin 0.4s ease,
            opacity 0.3s ease;
        opacity: 1;
        overflow: hidden;
    }

    /* Collapsed State */
    .info-panel.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        border-left: none !important;
        opacity: 0;
    }
}