/* Medical Image Viewer - Professional Styling */

:root {
    /* Professional grey-white color scheme */
    --primary-color: #6B7280; /* Medium grey */
    --primary-hover: #4B5563; /* Darker grey */
    --secondary-color: #9CA3AF; /* Light grey */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --bg-primary: #000000; /* Main panel pure black */
    --bg-secondary: #000000; /* Side/top panels pure black */
    --bg-tertiary: #000000; /* Sidebar/header pure black */
    --text-primary: #FFFFFF; /* White text */
    --text-secondary: #A0AEC0; /* Muted grey text */
    --text-muted: #6B7280;

    --border-color: #23263A;
    --border-light: #23263A;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

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

/* Disclaimer Styles */
.disclaimer {
    background: linear-gradient(90deg, #fffbe6 0%, #ffe066 100%); /* Standard disclaimer yellow */
    color: #7c4700;
    padding: 0.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #ffe066;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.disclaimer p {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.disclaimer i {
    font-size: 0.875rem;
}

/* Header */
.header {
    background: #000000;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
}

.header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    letter-spacing: -0.025em;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.3;
}

.header h1 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Branding Styles */
.branding {
    display: flex;
    align-items: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.brand-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.85;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0.015em;
    text-transform: uppercase;
}

.brand-icon {
    color: #D1D5DB; /* Light grey shade */
    margin-right: 0.5rem;
}

.ai-gradient {
    font-size: 1.5rem;
    font-weight: 400;
    background: linear-gradient(90deg, #888 0%, #bbb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.status-indicator.active {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* Compact Results Styles */
.results-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.compact-result-summary {
    margin-bottom: 1rem;
}

.compact-result-summary p {
    margin: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.compact-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.export-details {
    width: 100%;
}

.export-summary {
    cursor: pointer;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    outline: none;
}

.export-summary:hover {
    background: var(--bg-secondary);
}

.export-list {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.export-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.75rem;
}

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

.export-item .file-name {
    flex: 1;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-item .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: auto;
    border-radius: 2rem;
    border: 1px solid var(--primary-color);
    background: #0a0a0a;
    color: var(--primary-color);
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.export-item .btn:hover {
    background: #313132;
    color: var(--text-primary);
    border-color: #313132;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, #111 0%, #222 100%);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
}

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

.sidebar-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
    font-family: 'Inter', system-ui, sans-serif;
}

.sidebar-section h3 i {
    color: var(--text-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    letter-spacing: 0.005em;
    font-family: 'Inter', system-ui, sans-serif;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.4;
}

.form-select[multiple] {
    min-height: 8rem;
    overflow-y: auto;
}

.form-select[multiple] option {
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: var(--radius-sm);
}

.form-select[multiple] option:checked {
    background: #4a4a4a;
    color: white;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-help {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.005em;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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

input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    letter-spacing: 0.01em;
    font-family: 'Inter', system-ui, sans-serif;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

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

/* Viewer Container */
.viewer-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-content i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-progress {
    margin-top: 1.5rem;
    width: 300px;
    max-width: 80vw;
}

.loading-progress .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.loading-progress .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-progress .progress-text {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.welcome-content {
    max-width: 500px;
}

.welcome-content i {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.welcome-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    font-family: 'Inter', system-ui, sans-serif;
}

.welcome-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.005em;
}

.features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.005em;
}

.feature i {
    color: var(--primary-color);
}

/* Viewer Grid - Three equal panels */
.viewer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr auto;
    height: 100%;
    gap: 1px;
    background: var(--border-color);
}

.viewer-panel {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    min-height: 200px; /* Ensure minimum height for controls */
}

.viewer-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.info-panel {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    padding: 1rem;
    max-height: 150px;
    overflow-y: auto;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.viewer-header .header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viewer-header .fullscreen-btn {
    padding: 0.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-header .fullscreen-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.viewer-header .header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viewer-header .fullscreen-btn {
    padding: 0.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-header .fullscreen-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.viewer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.viewer-panel:hover .viewer-header::before {
    transform: translateX(0);
}

.viewer-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slice-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.viewer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0; /* Allow flexbox to shrink */
}

.image-container {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    min-height: 0; /* Allow shrinking */
}

.image-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: loading-slide 1.5s infinite;
    z-index: 5;
}

@keyframes loading-slide {
    0% { left: -100%; }
    100% { left: 100%; }
}

.medical-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* High-quality image rendering for smooth CT images */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    image-rendering: smooth;
    -ms-interpolation-mode: bicubic;
    transition: opacity 0.2s ease-in-out;
    transform-origin: center center;
    display: block; /* Show img tags for rendering */
    /* Anti-aliasing for better quality */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0);
    will-change: transform;
}

.image-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Ensure canvas can receive hover events */
canvas.medical-canvas {
    display: block;
    cursor: crosshair;
    /* High-quality canvas rendering */
    image-rendering: high-quality;
    image-rendering: smooth;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Smooth slice navigation indicators */
.slice-change-indicator {
    font-family: monospace;
    box-shadow: var(--shadow-md);
}

/* Enhanced slider with smooth animations */
.slice-slider {
    width: 100%;
    transition: all 0.2s ease-in-out;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border-color);
}

.slice-slider:hover {
    transform: scaleY(1.5);
    height: 10px;
}

.slice-slider:active {
    transform: scaleY(2);
    height: 12px;
}

/* Webkit browsers (Chrome, Safari, newer Edge) */
.slice-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.slice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    margin-top: -6px; /* Centers the thumb on the track */
}

.slice-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

/* Firefox */
.slice-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.slice-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.slice-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

/* Smooth hover effects for viewer panels */
.viewer-panel:hover .viewer-header {
    background: #4a4a4a;
    transition: background-color 0.2s ease-in-out;
}

.viewer-panel:hover .viewer-header h4 {
    color: white;
}

.viewer-controls {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    flex-shrink: 0; /* Prevent controls from shrinking */
}

/* Dragging cursor */
.image-container.dragging {
    cursor: ns-resize !important;
}

/* Panning cursor */
.image-container.panning {
    cursor: move !important;
}

/* Zoomed state cursor */
.image-container.zoomed {
    cursor: move;
}

/* Zoom interaction hint */
.image-container:hover::after {
    content: 'Ctrl+Wheel: Zoom | Double-click: Reset';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Slice progress indicator */
.slice-progress {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.slice-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--progress, 0%);
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.2s ease-out;
}

.image-container:hover .slice-progress,
.image-container.dragging .slice-progress {
    opacity: 1;
}

/* Info Panel */
.info-panel {
    background: var(--bg-secondary);
    padding: 1rem;
}

.info-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-content h4 i {
    color: var(--primary-color);
}

.image-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

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

.info-row span:last-child {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Organs Panel */
.organs-list {
    max-height: 300px;
    overflow-y: auto;
}

.organ-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    background: var(--bg-tertiary);
    font-size: 0.875rem;
}

.organ-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.organ-item span {
    flex: 1;
    color: var(--text-primary);
}

.organ-label {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Tooltip */
.organ-tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: none;
    max-width: 250px;
    min-width: 120px;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.organ-tooltip.with-color-accent {
    border-left-width: 4px;
}

.tooltip-content {
    white-space: nowrap;
}

/* Enhanced tooltip content */
.tooltip-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.organ-name {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.2rem;
}

.organ-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.tooltip-stats {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tooltip-stats div {
    margin-bottom: 0.2rem;
    display: flex;
    justify-content: space-between;
}

.tooltip-stats div:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .viewer-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(180px, 1fr) auto auto;
    }
    
    .viewer-panel:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .viewer-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, minmax(150px, 1fr)) auto;
    }
    
    .viewer-panel {
        grid-column: 1;
        min-height: 150px; /* Smaller minimum for mobile */
    }
    
    .info-panel {
        grid-column: 1;
        max-height: 120px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 100%;
        position: absolute;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        position: relative;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

input:focus,
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Upload and Segment Styles */
.form-file {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.form-file:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.form-file:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.file-info {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    word-break: break-all;
    white-space: normal;
    overflow-wrap: anywhere;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-details i {
    color: #A0AEC0 !important; /* Muted grey shade for file icons */
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.btn.btn-secondary {
    background: #4a4a4a;
    border-color: #4a4a4a;
    color: white;
}

.btn.btn-secondary:hover {
    background: #5a5a5a;
    border-color: #5a5a5a;
    color: white;
}

.btn.btn-secondary:disabled {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Viewer button hover effect */
.viewer-btn:hover {
    background: #5a5a5a !important;
    border-color: #5a5a5a !important;
    color: white !important;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 100%;
    animation: progressAnimation 2s infinite;
}

@keyframes progressAnimation {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

.notification i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.notification-success i {
    color: var(--success-color);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-info i {
    color: var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Segmentation Results Styles */
.segmentation-results {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.segmentation-results h3 {
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.segmentation-results p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.results-list {
    margin: 1rem 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

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

.result-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.result-item span {
    flex: 1;
    font-weight: 500;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.btn-sm i {
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Enhanced Segmentation Results Styling - Inspired by segment.py */
.segmentation-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
}

.segmentation-results h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.text-success {
    color: var(--success-color) !important;
}

.result-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--success-color);
}

.result-summary p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.result-summary p:last-child {
    margin-bottom: 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.results-actions {
    margin-bottom: 1.5rem;
}

.action-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.action-group h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    width: 100%;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.download-item:last-child {
    margin-bottom: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.btn-outline-primary {
    background: #0a0a0a;
    border: 1px solid #4a4a4a;
    color: #a0a0a0;
    border-radius: 2rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.btn-outline-primary:hover {
    background: #5a5a5a;
    color: white;
    border-color: #5a5a5a;
}

.btn-outline-secondary {
    background: #0a0a0a;
    border: 1px solid #4a4a4a;
    color: #a0a0a0;
    border-radius: 2rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.btn-outline-secondary:hover {
    background: #5a5a5a;
    color: white;
    border-color: #5a5a5a;
}

.action-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Viewer placeholder for loading states */
.viewer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
}

.viewer-placeholder i {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.viewer-placeholder p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.viewer-placeholder small {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Status indicators */
.status-active {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

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

.notification i {
    font-size: 1.25rem;
}

.notification-success i {
    color: var(--success-color);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-info i {
    color: var(--primary-color);
}

/* Fullscreen styles */
.fullscreen-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--bg-primary) !important;
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.fullscreen-panel .viewer-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.fullscreen-panel .viewer-header h4 {
    font-size: 1rem;
    font-weight: 700;
}

.fullscreen-panel .viewer-header .fullscreen-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.fullscreen-panel .viewer-header .fullscreen-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.fullscreen-panel .viewer-content {
    flex: 1;
    padding: 1rem;
}

.fullscreen-panel .image-container {
    height: calc(100vh - 120px); /* Account for header and controls */
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.fullscreen-panel .medical-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-panel .viewer-controls {
    padding: 1rem 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.fullscreen-panel .slice-slider {
    width: calc(100% - 2rem);
    margin: 0 1rem;
    height: 8px;
}

.fullscreen-panel .slice-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Fullscreen tooltip adjustments */
.fullscreen-panel .organ-tooltip {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Hide other UI elements when any panel is fullscreen */
body:has(.fullscreen-panel) .header,
body:has(.fullscreen-panel) .sidebar {
    display: none !important;
}

/* Smooth transitions */
.viewer-panel {
    transition: all 0.3s ease;
}

.fullscreen-panel * {
    transition: all 0.2s ease;
}

/* Bottom Results Section */
.bottom-results {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.bottom-results .segmentation-results {
    max-width: 1200px;
    margin: 0 auto;
}

.bottom-results .segmentation-results h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

.bottom-results .result-summary {
    margin-bottom: 1.5rem;
}

.bottom-results .result-summary p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bottom-results .results-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.bottom-results .action-group h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

.bottom-results .action-footer {
    margin-top: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Adjust main content to account for bottom results */
body:has(.bottom-results[style*="block"]) .main-content {
    margin-bottom: 300px;
}

#login-btn.btn.btn-primary.btn-large {
    border-radius: 2rem;
    border: 1px solid var(--primary-color);
    background: #0a0a0a;
    color: var(--primary-color);
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
#login-btn.btn.btn-primary.btn-large:hover {
    background: #313132;
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Landing Page Styles */
.homepage {
    display: flex;
    flex-direction: column;
    background: #000000;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Navigation Bar */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-justify-content: space-between;
    -moz-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.nav-brand {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0.75rem;
    -webkit-gap: 0.75rem;
    -moz-gap: 0.75rem;
}

/* Safari gap fallback */
@supports not (gap: 0.75rem) {
    .nav-brand > * + * {
        margin-left: 0.75rem;
    }
}

.brand-logo {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.nav-brand .brand-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 2rem;
    -webkit-gap: 2rem;
    -moz-gap: 2rem;
}

/* Safari gap fallback for nav links */
@supports not (gap: 2rem) {
    .nav-links > * + * {
        margin-left: 2rem;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

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

/* Landing Sections - Stack Vertically */
.landing-section {
    padding: 6rem 0;
    display: block;
    width: 100%;
    float: none;
    position: relative;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: block;
}

.section-header {
    margin-bottom: 4rem;
    display: block;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.section-divider {
    display: none;
}

/* Hero Section */
.hero-section {
    background: #000000;
    position: relative;
    padding-top: 8rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Horizontal traces */
        linear-gradient(90deg, transparent 0%, transparent calc(50% - 1px), rgba(218, 165, 32, 0.3) calc(50% - 1px), rgba(218, 165, 32, 0.3) calc(50% + 1px), transparent calc(50% + 1px), transparent 100%),
        /* Vertical traces */
        linear-gradient(0deg, transparent 0%, transparent calc(50% - 1px), rgba(218, 165, 32, 0.3) calc(50% - 1px), rgba(218, 165, 32, 0.3) calc(50% + 1px), transparent calc(50% + 1px), transparent 100%),
        /* Connection nodes */
        radial-gradient(circle at 25% 25%, rgba(218, 165, 32, 0.4) 0%, rgba(218, 165, 32, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 75% 25%, rgba(218, 165, 32, 0.4) 0%, rgba(218, 165, 32, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 25% 75%, rgba(218, 165, 32, 0.4) 0%, rgba(218, 165, 32, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 75% 75%, rgba(218, 165, 32, 0.4) 0%, rgba(218, 165, 32, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 50% 50%, rgba(218, 165, 32, 0.5) 0%, rgba(218, 165, 32, 0.5) 4px, transparent 4px);
    background-size: 120px 120px, 120px 120px, 120px 120px, 120px 120px, 120px 120px, 120px 120px, 120px 120px;
    background-position: 0 0;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 300%;
    height: 100%;
    background: 
        /* Animated light pulse */
        radial-gradient(ellipse 150px 100px at var(--light-x, 0%) 30%, rgba(255, 215, 0, 0.6), rgba(255, 215, 0, 0.3) 30%, transparent 60%),
        radial-gradient(ellipse 150px 100px at var(--light-x, 10%) 50%, rgba(255, 215, 0, 0.5), rgba(255, 215, 0, 0.2) 30%, transparent 60%),
        radial-gradient(ellipse 150px 100px at var(--light-x, 20%) 70%, rgba(255, 215, 0, 0.6), rgba(255, 215, 0, 0.3) 30%, transparent 60%);
    background-size: 100% 100%;
    animation: circuitLightFlow 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
}

@keyframes circuitLightFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(0);
        opacity: 0;
    }
}

.hero-gradient {
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle at 30% 50%, rgba(45, 127, 249, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(45, 127, 249, 0.08) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-5%, 5%) scale(1.1);
    }
}

.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(45, 127, 249, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 127, 249, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 30s linear infinite;
    opacity: 0.5;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(60px, 60px);
    }
}

.hero-content {
    text-align: left;
    max-width: 1000px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title.animate-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    line-height: 1.7;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle.animate-in {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-description {
    display: none;
}

.hero-actions {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-actions.animate-in {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
}

.disclaimer-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* About Section */
.about-section {
    background: #000000;
    border-top: 1px solid var(--border-color);
    display: block;
    width: 100%;
}

.about-content {
    display: block;
    width: 100%;
}

.about-text {
    max-width: 900px;
    margin-bottom: 3rem;
    display: block;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.features-grid {
    display: -webkit-grid;
    display: -ms-grid;
    display: grid;
    -webkit-grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    -ms-grid-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    -webkit-gap: 1.5rem;
    -moz-gap: 1.5rem;
}

/* Safari grid fallback for features */
@supports not (display: grid) {
    .features-grid {
        display: -webkit-flex;
        display: -moz-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -moz-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-justify-content: space-between;
        -moz-justify-content: space-between;
        -ms-flex-pack: justify;
        justify-content: space-between;
    }
    
    .feature-card {
        -webkit-flex: 0 0 calc(50% - 0.75rem);
        -moz-flex: 0 0 calc(50% - 0.75rem);
        -ms-flex: 0 0 calc(50% - 0.75rem);
        flex: 0 0 calc(50% - 0.75rem);
        margin-bottom: 1.5rem;
    }
}

.feature-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem 1.75rem;
    text-align: left;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.feature-card.animate-in {
    animation: fadeSlideUp 0.6s ease-out forwards;
}

.feature-card:nth-child(1).animate-in {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2).animate-in {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3).animate-in {
    animation-delay: 0.3s;
}

.feature-card:nth-child(4).animate-in {
    animation-delay: 0.4s;
}

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

.feature-card:hover {
    border-color: rgba(45, 127, 249, 0.4);
    background: rgba(10, 10, 10, 0.5);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.feature-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    background: #000000;
    border-top: 1px solid var(--border-color);
}

.contact-content {
    max-width: 900px;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.contact-info > p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.contact-methods {
    display: grid;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-method:hover {
    border-color: rgba(45, 127, 249, 0.4);
    background: rgba(10, 10, 10, 0.5);
}

.contact-method i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.125rem;
}

.contact-method strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    font-weight: 600;
}

.contact-method p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

/* Footer */
.landing-footer {
    background: #000000;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
}

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

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-column a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
    cursor: pointer;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Team Section */
.team-section {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

.team-grid {
    display: -webkit-grid;
    display: -ms-grid;
    display: grid;
    -webkit-grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    -ms-grid-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    -webkit-gap: 2.5rem;
    -moz-gap: 2.5rem;
    margin-top: 3rem;
}

/* Safari grid fallback */
@supports not (display: grid) {
    .team-grid {
        display: -webkit-flex;
        display: -moz-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -moz-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-justify-content: space-between;
        -moz-justify-content: space-between;
        -ms-flex-pack: justify;
        justify-content: space-between;
    }
    
    .team-member {
        -webkit-flex: 0 0 calc(50% - 1.25rem);
        -moz-flex: 0 0 calc(50% - 1.25rem);
        -ms-flex: 0 0 calc(50% - 1.25rem);
        flex: 0 0 calc(50% - 1.25rem);
        margin-bottom: 2.5rem;
    }
}

.team-member {
    background: #1a1a1a;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    -webkit-transition: -webkit-transform 0.3s ease, box-shadow 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease, box-shadow 0.3s ease;
    -ms-transition: -ms-transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-transform: translateZ(0); /* Force hardware acceleration */
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
}

.team-member:hover {
    -webkit-transform: translateY(-5px) translateZ(0);
    -moz-transform: translateY(-5px) translateZ(0);
    -ms-transform: translateY(-5px) translateZ(0);
    transform: translateY(-5px) translateZ(0);
    box-shadow: var(--shadow-lg);
}

.member-photo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    width: 150px;
    height: 150px;
}

.member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(107, 114, 128, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.member-photo-container:hover .photo-overlay {
    opacity: 1;
}

.member-photo-container:hover .member-photo {
    transform: scale(1.1);
}

.photo-overlay i {
    color: white;
    font-size: 1.5rem;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.member-photo-container.active .photo-overlay i {
    transform: rotate(45deg);
}

.member-info {
    margin-bottom: 1rem;
}

.member-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.member-role {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
}

.member-details {
    max-height: none;
    overflow: visible;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding-top 0.3s ease;
    opacity: 1;
    text-align: left;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.member-details.expanded {
    max-height: none;
    opacity: 1;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.member-details p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.member-specialties {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -moz-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.5rem;
    -webkit-gap: 0.5rem;
    -moz-gap: 0.5rem;
    margin-top: 1rem;
}

/* Safari gap fallback for specialties */
@supports not (gap: 0.5rem) {
    .member-specialties > * + * {
        margin-left: 0.5rem;
    }
    .member-specialties > *:nth-child(n+3) {
        margin-top: 0.5rem;
    }
}

.specialty-tag {
    background: rgba(107, 114, 128, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.member-social {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(107, 114, 128, 0.2);
}

.social-link {
    display: -webkit-inline-flex;
    display: -moz-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0.5rem;
    -webkit-gap: 0.5rem;
    -moz-gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    transition: all 0.3s ease;
    background: transparent;
}

/* Safari gap fallback for social links */
@supports not (gap: 0.5rem) {
    .social-link > * + * {
        margin-left: 0.5rem;
    }
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.social-link i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        -webkit-gap: 1rem;
        -moz-gap: 1rem;
    }
    
    /* Safari gap fallback for mobile nav links */
    @supports not (gap: 1rem) {
        .nav-links > * + * {
            margin-left: 1rem;
        }
    }
    
    .nav-link {
        display: none;
    }
    
    .landing-section {
        padding: 4rem 0;
    }
    
    .hero-section {
        padding-top: 6rem;
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .features-grid {
        -webkit-grid-template-columns: 1fr;
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
    }
    
    /* Safari grid fallback for mobile features */
    @supports not (display: grid) {
        .feature-card {
            -webkit-flex: 1 1 100%;
            -moz-flex: 1 1 100%;
            -ms-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }
    
    .team-grid {
        -webkit-grid-template-columns: 1fr;
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        -webkit-gap: 1.5rem;
        -moz-gap: 1.5rem;
    }
    
    /* Safari grid fallback for mobile team */
    @supports not (display: grid) {
        .team-member {
            -webkit-flex: 1 1 100%;
            -moz-flex: 1 1 100%;
            -ms-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }
    
    .team-member {
        padding: 1.5rem;
    }
    
    .member-photo-container {
        width: 120px;
        height: 120px;
    }
    
    .footer-content {
        -webkit-grid-template-columns: 1fr;
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        gap: 2rem;
        -webkit-gap: 2rem;
        -moz-gap: 2rem;
    }
}