/* CSS Loading Performance Optimizations */
/* Prevent layout shifts and improve initial render */

/* Critical rendering path optimizations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure smooth transitions after styles load */
html {
    scroll-behavior: smooth;
}

/* Prevent FOUC with font loading */
.fonts-loaded {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fonts-loading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Optimize paint and layout */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Critical layout containment */
.app-container {
    contain: layout style paint;
}

.sidebar {
    contain: layout style paint;
}

.main-content {
    contain: layout style paint;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: auto !important; /* Allow scrollbars */
}

:root {
    /* Dark Theme (Default) */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #475569;
    --border-light: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Light Theme */
[data-theme="light"] {
    /* Accent colors are kept the same as the dark theme */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Modern, neutral background palette */
    --bg-primary: #f8fafc;   /* A very light, clean off-white (was skyblue) */
    --bg-secondary: #f1f5f9; /* A slightly darker gray for sidebars/panels (was powderblue) */
    --bg-tertiary: #e2e8f0;  /* Used for hover states on list items, etc. */
    --bg-card: #ffffff;      /* Pure white for cards to make them pop */
    
    /* High-contrast text colors (inverted from dark theme bg) */
    --text-primary: #0f172a;   /* A strong, dark slate for headings and primary text */
    --text-secondary: #334155; /* A softer slate for body copy */
    --text-muted: #64748b;     /* Kept the same for consistency */
    
    /* Subtle borders for a clean look */
    --border-color: #cbd5e1;
    --border-light: #e2e8f0;
    
    /* Shadows can remain the same as they are defined by their opacity */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: auto !important; /* Allow scrollbars */
    transition: var(--transition);
    margin: 0;
    padding: 0;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 290px 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto !important;
    min-width: 0;
}

/* Fade out sidebars when instructions are active */
.app-container.instructions-active .sidebar {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    transition: var(--transition);
    margin-left: 0;
    padding-left: 0;
}



.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    
    /* CSS Custom Properties for dynamic glow */
    --glow-intensity: 0.3;
    --glow-radius: 20px;
    --glow-opacity: 0.3;
    --pulse-frequency: 2s;
    --glow-hue: 240;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.logo.logo-hover::before {
    left: 100%;
}

.logo img {
    height: 32px;
    width: auto;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    filter: brightness(1) contrast(1);
}

.logo.logo-hover img {
    transform: scale(1.05) rotate(360deg);
    filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 8px hsla(var(--glow-hue), 70%, 70%, 0.6));
    animation: logoSpin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.logo i {
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.logo.logo-hover i {
    color: hsl(var(--glow-hue), 70%, 70%);
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px hsla(var(--glow-hue), 70%, 70%, 0.6));
    animation: logoIconPulse 2s ease-in-out infinite;
}

.logo h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    text-shadow: 0 0 0 transparent;
}

.logo.logo-hover h1 {
    color: var(--text-primary);
    text-shadow: none;
    transform: none;
    animation: none;
}

.logo.logo-hover {
    background: none;
    box-shadow: none;
    transform: none;
    animation: none;
}

/* Status Panel - No hover effects */
#statusPanel:hover {
    /* No animations or effects on hover */
}

@keyframes logoIconPulse {
    0%, 100% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 8px hsla(var(--glow-hue), 70%, 70%, 0.6));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 12px hsla(var(--glow-hue), 70%, 70%, 0.8));
    }
}

@keyframes logoTextGlow {
    0%, 100% {
        text-shadow: 0 0 6px hsla(var(--glow-hue), 70%, 70%, 0.5);
    }
    50% {
        text-shadow: 0 0 10px hsla(var(--glow-hue), 70%, 70%, 0.7);
    }
}

@keyframes logoSpin {
    0% {
        transform: scale(1.05) rotate(0deg);
    }
    100% {
        transform: scale(1.05) rotate(360deg);
    }
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.help-btn {
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    padding: 0.25rem;
}

.help-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}





.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
    box-shadow: 
        0 0 8px rgba(99, 102, 241, 0.4),
        0 0 15px rgba(99, 102, 241, 0.25),
        0 0 25px rgba(99, 102, 241, 0.15),
        0 0 35px rgba(99, 102, 241, 0.08),
        inset 0 0 25px rgba(99, 102, 241, 0.03);
    animation: laserGlow 2s ease-in-out infinite;
}



.sidebar-content {
    flex: 1;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    opacity: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    max-width: 200px;
}

.scroll-indicator.show {
    opacity: 1;
    animation: slideInUp 0.3s ease-out;
}

.scroll-arrow {
    color: var(--primary-color);
    animation: bounce 2s infinite;
    font-size: 0.875rem;
}

.scroll-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

.control-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.control-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-section h3 i {
    color: var(--primary-color);
}

/* Edit Section Dividers */
.edit-section-divider {
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.edit-section-divider:first-child {
    margin-top: 0;
}

.edit-section-divider h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edit-section-divider h4 i {
    font-size: 1rem;
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.control-group label i {
    color: var(--accent-color);
    width: 16px;
}

/* Auto-save wand icon styling */
.control-group .d-flex .fas.fa-magic {
    color: #38bdf8; /* light blue */
    font-size: 0.875rem;
    width: 14px;
}

.control-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

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

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.slider-container span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 2rem;
    text-align: center;
}

.control-group input[type="number"],
.control-group input[type="text"],
.control-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.control-group input[type="number"]:focus,
.control-group input[type="text"]:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.control-group input[type="number"]::placeholder,
.control-group input[type="text"]::placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Override browser default styling for number inputs */
.control-group input[type="number"] {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Remove spinner buttons from number inputs */
.control-group input[type="number"]::-webkit-outer-spin-button,
.control-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.control-group input[type="number"]::-moz-inner-spin-button,
.control-group input[type="number"]::-moz-outer-spin-button {
    -moz-appearance: textfield;
}

/* Color input styles */
.control-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.control-group input[type="color"]:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.control-group input[type="color"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Color input webkit styles */
.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: var(--radius-md);
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Color input container for edit mode */
.color-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-container input[type="color"] {
    width: 50px;
    height: 40px;
    flex-shrink: 0;
}

.color-input-container input[type="text"] {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.edit-label-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.edit-label-container input {
    flex: 1;
}

.edit-label-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 750px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease-out;
}

.modal-content h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-content h3 i {
    color: var(--primary-color);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.load-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.load-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.load-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.load-section h4 i {
    color: var(--primary-color);
}

.load-graphs-list {
    max-height: 200px;
    overflow-y: auto;
}

.load-graph-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.12rem;
    background: var(--bg-secondary);
    transition: var(--transition);
    min-height: 24px;
    /* Ensure proper text wrapping */
    min-height: fit-content;
    flex-wrap: nowrap;
}

.load-graph-actions {
    display: flex;
    gap: 0.15rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.load-graph-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.load-graph-item.pending-delete {
    border-color: var(--danger-color);
    border-width: 2px;
    background: rgba(239, 68, 68, 0.1);
    position: relative;
}

/* Always show solid colors for action buttons in pending-delete state */
.load-graph-item.pending-delete .load-graph-actions .confirm-delete-btn {
    background: var(--success-color) !important;
    color: white !important;
    border: 1px solid var(--success-color) !important;
}

.load-graph-item.pending-delete .load-graph-actions .delete-btn {
    background: var(--danger-color) !important;
    color: white !important;
    border: 1px solid var(--danger-color) !important;
}

/* Light blue edit button for load window */
.load-graph-actions .edit-name-btn {
    border-color: #60a5fa !important;
    color: #60a5fa !important;
}

.load-graph-actions .edit-name-btn:hover {
    background: #60a5fa !important;
    color: white !important;
    border-color: #60a5fa !important;
}

/* Fix icon centering in load modal action buttons */
.load-graph-actions .btn-sm {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.375rem !important;
    width: 32px !important;
    height: 32px !important;
}

.load-graph-actions .btn-sm i {
    margin: 0 !important;
    font-size: 0.75rem;
}



.load-graph-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.load-graph-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.06rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.1;
    max-width: 100%;
    /* Responsive font sizing for very long names */
    font-size: clamp(0.7rem, 2.5vw, 0.8rem);
}

.load-graph-details {
    font-size: 0.62rem;
    color: var(--text-secondary);
    margin-bottom: 0.06rem;
}

.load-graph-time {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.load-graph-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.no-graphs {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem;
}

/* Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.button-group.d-flex {
    flex-direction: row;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(90deg, #818cf8, #6366f1);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-primary.active {
    background: linear-gradient(135deg, var(--success-color), #059669);
    animation: pulse 2s infinite;
}

.btn-secondary {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border: 1px solid #1d4ed8;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    border-color: #1e40af;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(90deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-danger {
    background: linear-gradient(90deg, #fbbf24, #d97706);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(90deg, #f59e0b, #b45309);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-warning {
    background: linear-gradient(90deg, #fbbf24, #d97706);
    color: white !important;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(90deg, #f59e0b, #b45309);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white !important;
}

/* Ensure stop search button text is always white */
#stopSearch {
    background: linear-gradient(90deg, #fbbf24, #d97706) !important;
    color: white !important;
}

#stopSearch:hover {
    background: linear-gradient(90deg, #f59e0b, #b45309) !important;
    color: white !important;
}

.btn-info {
    background: linear-gradient(90deg, #fbbf24, #d97706);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(90deg, #f59e0b, #b45309);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Saved Graphs */
.saved-graphs {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.saved-graphs h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saved-graphs h4 i {
    color: var(--accent-color);
}

.saved-graphs-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.saved-graph-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.4rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0.2rem;
    /* Ensure proper text wrapping */
    min-height: fit-content;
    flex-wrap: nowrap;
}

.saved-graph-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.08rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.1;
    max-width: 100%;
    /* Responsive font sizing for very long names */
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
}

.saved-graph-details {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.saved-graph-time {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.08rem;
}

.saved-graph-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.75rem;
}

.saved-graph-item:hover {
    background: var(--border-color);
    transform: translateX(2px);
    border-color: var(--primary-color);
}

.saved-graph-item::before {
    content: '📁';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
    font-size: 0.875rem;
}

.saved-graph-item:hover::before {
    opacity: 1;
    left: -15px;
}

.saved-graph-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.saved-graph-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.08rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.1;
    max-width: 100%;
    /* Responsive font sizing for very long names */
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
}

.saved-graph-details {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.saved-graph-time {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.08rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-graph-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.saved-graph-actions button {
    padding: 0.18rem 0.3rem;
    font-size: 0.8rem;
}

.saved-graph-actions button:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.saved-graph-actions .edit-name-btn:hover {
    color: var(--info-color);
}

.saved-graph-actions .delete-btn:hover {
    color: var(--danger-color);
}

.saved-graph-item.pending-delete {
    border-color: var(--danger-color);
    border-width: 2px;
    background: rgba(239, 68, 68, 0.1);
    position: relative;
}

/* Always show solid colors for action buttons in pending-delete state */
.saved-graph-item.pending-delete .saved-graph-actions .confirm-delete-btn {
    background: var(--success-color) !important;
    color: white !important;
    border: 1px solid var(--success-color) !important;
}

.saved-graph-item.pending-delete .saved-graph-actions .delete-btn {
    background: var(--danger-color) !important;
    color: white !important;
    border: 1px solid var(--danger-color) !important;
}

.saved-graph-item.pending-rename {
    border-color: var(--warning-color);
    background: var(--bg-tertiary);
}

.saved-graph-item.pending-rename .saved-graph-name {
    color: var(--warning-color);
    font-weight: 700;
}

.saved-graph-item.pending-rename .saved-graph-name::after {
    content: ' (renamed)';
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

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

/* Compact Statistics */
.stats-compact {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.stat-compact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    flex: 1;
    justify-content: center;
}

.stat-compact-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.stat-compact-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.distance-info,
.path-info,
.search-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-color);
    display: none;
    margin-top: 0.75rem;
}

.distance-info.show,
.path-info.show,
.search-info.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.path-info {
    border-left-color: var(--warning-color);
}

.search-info {
    border-left-color: var(--success-color);
}

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

/* Main Content */
.main-content {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden; /* Remove scrollbars from main content */
    transition: var(--transition);
    margin-right: 290px; /* Make room for right sidebar */
    padding-right: 0;
    padding-bottom: 0;
    min-width: 0;
    width: auto;
    min-height: 0; /* Allow content to shrink */
    /* Ensure proper positioning */
    position: relative;
}

/* Right Sidebar */
.right-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    overflow: hidden;
}

.right-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.right-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.right-sidebar-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.right-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.right-sidebar-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

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

.right-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.canvas-container {
    position: relative;
    width: 2000px;
    height: 2000px;
    /* Ensure proper canvas rendering */
    overflow: hidden;
    margin: 0 auto;
    /* Ensure canvas is properly positioned */
    display: block;
}

/* Scrollable wrapper for the canvas */
.canvas-scroll-wrapper {
    width: 100%;
    height: 100vh; /* Full viewport height since no footer */
    overflow: auto;
    position: relative;
    margin: 0;
    background: var(--bg-primary);
    margin-bottom: 0;
    display: block;
    /* Ensure scrollbars appear */
    z-index: 1;
}

/* Custom scrollbar styling for canvas scroll wrapper - matching horizontal scrollbar */
.canvas-scroll-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.canvas-scroll-wrapper::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 10px;
    margin: 2px;
}

.canvas-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 10px;
    border: 1px solid #374151;
    min-height: 30px;
    min-width: 30px;
}

.canvas-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.canvas-scroll-wrapper::-webkit-scrollbar-corner {
    background: #374151;
}

/* Light theme scrollbar adjustments */
[data-theme="light"] .canvas-scroll-wrapper::-webkit-scrollbar-track {
    background: #e5e7eb;
}

[data-theme="light"] .canvas-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border: 2px solid #e5e7eb;
}

[data-theme="light"] .canvas-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

[data-theme="light"] .canvas-scroll-wrapper::-webkit-scrollbar-corner {
    background: #e5e7eb;
}

/* Custom scrollbar styling for canvas container */
.canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.canvas-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
}

.canvas-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

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

.canvas-container::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Canvas Container */
.white-box-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 2000px;
    height: 2000px;
    border: 2px solid var(--border-color);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

#graphCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 2000px;
    height: 2000px;
    background: #374151; /* Dark gray for dark mode */
    cursor: crosshair;
    display: block;
    transition: var(--transition);
    margin: 0;
    padding: 0;
    pointer-events: auto;
    /* Prevent rendering artifacts */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Cursor overrides for modes using inline SVG data URLs */
body.edit-mode-active #graphCanvas {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23a78bfa%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27><path d=%27M12 20h9%27/><path d=%27M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z%27/></svg>") 2 22, crosshair;
}

body.delete-mode-active #graphCanvas {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23f87171%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27><line x1=%2718%27 y1=%276%27 x2=%276%27 y2=%2718%27/><line x1=%276%27 y1=%276%27 x2=%2718%27 y2=%2718%27/></svg>") 12 12, not-allowed;
}

[data-theme="light"] #graphCanvas {
    background: #e0f2fe; /* Light blue for light mode */
}

/* Instructions Overlay */
.instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

[data-theme="light"] .instructions-overlay {
    background: rgba(255, 255, 255, 0.95);
}

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

/* Optimize instructions overlay for faster loading */
.instructions-overlay {
    animation: fadeIn 0.15s ease-out; /* Reduced from 0.3s to 0.15s */
}

/* Drag and Drop Styles */
.canvas-container {
    position: relative;
    transition: all 0.2s ease;
}

.canvas-container.drag-active {
    border: 3px dashed var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
}

#dragOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 92, 246, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
    border: 3px dashed #8b5cf6;
    color: white;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
    backdrop-filter: blur(5px);
}

#dragOverlay.show {
    display: flex;
    animation: dragPulse 1s ease-in-out infinite;
}

.drag-overlay-content {
    padding: 2rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.drag-overlay-content i {
    display: block;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out infinite;
}

.drag-overlay-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.drag-overlay-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

@keyframes dragPulse {
    0% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
        transform: scale(1);
    }
}

/* Drop zone hint */
.drop-zone-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.drop-zone-hint:hover {
    opacity: 1;
}

.drop-zone-hint i {
    margin-right: 0.25rem;
    color: var(--secondary-color);
}

/* Modal Drag and Drop Styles */
.modal-content.drag-active {
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.drag-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.drag-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.drag-drop-zone.drag-active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.drag-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.drag-drop-content i {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.drag-drop-zone.drag-active .drag-drop-content i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.drag-drop-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.drag-drop-subtitle {
    font-size: 0.875rem !important;
    color: var(--text-muted) !important;
    font-weight: normal !important;
}

.drag-drop-zone.drag-active .drag-drop-content p {
    color: var(--primary-color);
}

/* Animation for drag drop zone */
@keyframes modalDragPulse {
    0% {
        box-shadow: 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.drag-drop-zone.drag-active {
    border: 3px dashed var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    animation: modalDragPulse 1s infinite;
}

/* Loading Animation Styles */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: var(--secondary-color);
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: var(--accent-color);
    animation-duration: 0.8s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.loading-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.loading-progress {
    width: 100%;
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

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

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

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

/* Modal Warning Styles */
.modal-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    animation: warningSlideIn 0.3s ease-out;
}

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

.warning-content i {
    color: #ef4444;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.warning-content span {
    font-size: 0.9rem;
    line-height: 1.4;
}

@keyframes warningSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.instructions-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    max-height: 90vh;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    overflow-y: scroll;
    overflow-x: hidden;
}

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

.instructions-content h3 i {
    color: var(--warning-color);
}

.instruction-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.instruction-item:hover {
    transform: translateX(3px);
    border-color: var(--primary-color);
}

.instruction-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.instruction-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.instruction-text strong {
    color: var(--text-primary);
}





/* General time display styling (for other contexts) */
.time-display {
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: center;
}

.time-display:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* Analog clock styling */
.analog-clock {
    color: var(--text-primary);
    transition: var(--transition);
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.time-display:hover .analog-clock {
    color: var(--primary-color);
}



/* LinkedIn link styling */
.linkedin-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

.linkedin-link:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.linkedin-link::after {
    content: '🔗';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
    font-size: 0.75rem;
}

.linkedin-link:hover::after {
    opacity: 1;
    right: -25px;
}

/* Contact link styling */
.contact-status-item {
    cursor: pointer;
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: inline-block;
    cursor: pointer;
    /* pointer-events: none; */
}

.contact-status-item:hover .contact-link {
    color: var(--primary-color);
    transform: scale(1.05);
}



/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 290px 1fr;
    }
    
    .sidebar-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .sidebar {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-color);
        max-height: 300px;
    }
    
    .main-content {
        order: 1;
        margin-right: 0;
    }
    
    .right-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        height: 100vh; /* Full height on mobile */
    }
    
    .right-sidebar.show {
        transform: translateX(0);
    }
    

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

@media (max-width: 480px) {
    .sidebar-content {
        padding: 0.75rem;
    }
    
    .control-section {
        padding: 1rem;
    }
    
    .instructions-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .instruction-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

/* Canvas-specific styles for better interaction */
#graphCanvas {
    /* Remove touch-action restriction that could interfere with dragging */
    touch-action: manipulation;
}

/* Selection states for vertices */
.vertex-selected {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Hover effects for better UX */
.control-group:hover {
    transform: translateY(-1px);
}

.stat-item:hover .stat-value {
    color: var(--accent-color);
}

/* Expandable Section Styles */
.expandable-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex: 1;
    text-align: center;
    margin: 0;
}



.expandable-header:hover {
    color: var(--primary-color);
}

.expand-icon {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
    margin-right: 3px;
}

.expandable-header:hover .expand-icon {
    color: var(--primary-color);
}

.expandable-header.expanded .expand-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.expandable-content {
    display: none;
    overflow: hidden;
    transition: all 0.15s ease-out;
}

.expandable-content.show {
    display: block !important;
    animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search animation states */
.vertex-visited {
    animation: visited 0.5s ease-out;
}

.vertex-path {
    animation: path 0.5s ease-out;
}

@keyframes visited {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes path {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation speed slider styles */
.slider-container {
    position: relative;
    margin-top: 0.5rem;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

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

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-label-left,
.slider-label-right {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    min-width: 2rem;
}

.slider-label-left {
    color: var(--success-color);
    margin-right: 0.75rem;
}

.slider-label-right {
    color: var(--warning-color);
    margin-left: 0.75rem;
} 

/* Edit Mode Styles */
.edit-mode-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent-color);
}

.edit-mode-info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.edit-mode-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

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

.edit-mode-item i {
    color: var(--accent-color);
    width: 16px;
    text-align: center;
}

.edit-mode-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

#editControlsSection {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

#editControlsSection h3 {
    color: var(--text-secondary);
}

/* Edit Controls Grid Layout */
.edit-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.edit-control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.edit-control-row .control-group {
    margin-bottom: 0;
}

/* Switch Styling */
.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0;
    padding: 0.5rem 0;
}

.switch-label i {
    color: var(--accent-color);
    width: 16px;
    text-align: center;
    margin-right: 0.5rem;
}

.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-container input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: var(--transition);
    border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.switch-container input:checked + .switch-slider:before {
    transform: translateX(20px);
    background-color: white;
}

.switch-container:hover .switch-slider {
    border-color: var(--primary-color);
}

/* Checkbox Styling (keeping for other uses) */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-label i {
    color: var(--accent-color);
    width: 16px;
    text-align: center;
}

#vertexEditControls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#vertexEditControls h4 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Shake animation for edit mode */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-0.1px); }
    75% { transform: translateX(0.1px); }
}

.edit-mode-shake {
    animation: shake 0.1s infinite;
} 

.instructions-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
.instructions-close:hover {
    color: var(--danger-color);
} 

/* Target Vertex Display */
.target-vertex-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

#resetTargetBtn {
    opacity: 0.5;
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    transition: opacity 0.2s;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    padding: 0;
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
}

#resetTargetBtn:hover {
    opacity: 1;
    color: var(--primary-color);
}

.target-vertex-display:hover #resetTargetBtn {
    opacity: 1;
}

.target-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    transition: var(--transition);
    overflow: hidden; /* Prevent content from overflowing */
}

.target-display.has-target {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.target-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.target-vertex-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

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

.target-vertex-icon {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.target-vertex-label {
    font-size: 0.875rem;
}

.target-vertex-coords {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
} 



.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover::before {
    left: 100%;
}

.btn-outline-primary i {
    margin-right: 0.5rem;
    transition: var(--transition);
}

.btn-outline-primary:hover i {
    transform: scale(1.1);
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.btn-outline-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--danger-color);
}

.btn-outline-danger:hover::before {
    left: 100%;
}

.btn-outline-danger i {
    margin-right: 0.5rem;
    transition: var(--transition);
}

.btn-outline-danger:hover i {
    transform: scale(1.1);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.btn-outline-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-outline-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover::before {
    left: 100%;
}

.btn-outline-secondary i {
    margin-right: 0.5rem;
    transition: var(--transition);
}

.btn-outline-secondary:hover i {
    transform: scale(1.1);
}

.btn-outline-info {
    background: transparent;
    border: 2px solid var(--info-color);
    color: var(--info-color);
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.btn-outline-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-outline-info:hover {
    background: var(--info-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--info-color);
}

.btn-outline-info:hover::before {
    left: 100%;
}

.btn-outline-info i {
    margin-right: 0.5rem;
    transition: var(--transition);
}

.btn-outline-info:hover i {
    transform: scale(1.1);
}

/* Custom button styles for specific buttons */
#deleteNodesBtn {
    background: linear-gradient(135deg, rgb(252, 61, 3), #e53e3e) !important;
    color: white !important;
}

#deleteNodesBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e53e3e, #c53030) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white !important;
}

#deleteAllGraphs {
    background: linear-gradient(90deg, #f87171, #ef4444) !important;
    color: white !important;
    border: none !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.6rem !important;
}

/* Ensure shared confirmation buttons are hidden by default */
#sharedConfirmation {
    display: none !important;
}

#deleteAllGraphs:hover:not(:disabled) {
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#clearGraph {
    background: linear-gradient(90deg, #fbbf24, #d97706) !important;
    color: white !important;
    border: none !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.6rem !important;
}

#clearGraph:hover:not(:disabled) {
    background: linear-gradient(90deg, #f59e0b, #b45309) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Consistent hover effects for all sidebar buttons */
.sidebar .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sidebar .btn-outline-primary:hover:not(:disabled),
.sidebar .btn-outline-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Contact Modal Styles - Fixed Implementation with Theme Colors */
#contactModal {
    z-index: 9999 !important;
}

/* Completely disable ALL hover effects for the entire contact modal */
#contactModal *:hover,
#contactModal *:active,
#contactModal *:focus {
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    background-color: inherit !important;
    color: inherit !important;
    border-color: inherit !important;
    transition: none !important;
    animation: none !important;
}

#contactModal .modal-dialog {
    z-index: 10000 !important;
}

#contactModal .modal-content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    position: relative !important;
    z-index: 10001 !important;
    overflow: hidden !important;
}

#contactModal .modal-header {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 1.5rem !important;
}

#contactModal .modal-title {
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
}

#contactModal .modal-title i {
    color: var(--primary-color) !important;
    font-size: 1.25rem !important;
}

#contactModal .modal-body {
    background: var(--bg-secondary) !important;
    padding: 1.5rem !important;
}

#contactModal .contact-form-section h6 {
    color: var(--text-secondary) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

#contactModal .modal-footer {
    background: var(--bg-tertiary) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 0 8px 8px !important;
    padding: 1.5rem !important;
}

#contactModal .form-label {
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Prevent auto-fill styling glitch */
#contactModal input:-webkit-autofill,
#contactModal input:-webkit-autofill:hover,
#contactModal input:-webkit-autofill:focus,
#contactModal input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-primary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Additional autofill prevention */
#contactModal input,
#contactModal textarea {
    -webkit-autocomplete: off !important;
    -moz-autocomplete: off !important;
    autocomplete: off !important;
}

/* Enhanced form spacing */
#contactModal .mb-3 {
    margin-bottom: 1rem !important;
}

#contactModal .form-label i {
    color: var(--text-secondary) !important;
    width: 16px !important;
    text-align: center !important;
    font-size: 0.875rem !important;
}

/* Duplicate removed */

/* Critical fix: Override any inherited styles for form controls */
#contactModal .form-control,
#contactModal input[type="text"],
#contactModal input[type="email"],
#contactModal textarea {
    width: 100% !important;
    padding: 0.75rem !important;
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    font-size: 0.875rem !important;
    position: relative !important;
    z-index: 10002 !important;
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    opacity: 1 !important;
    /* Override any inherited background colors */
    background-color: var(--bg-primary) !important;
    background-image: none !important;
}

#contactModal .form-control:focus,
#contactModal input[type="text"]:focus,
#contactModal input[type="email"]:focus,
#contactModal textarea:focus {
    background: var(--bg-primary) !important;
    border-color: var(--primary-color) !important;
    outline: none !important;
    background-color: var(--bg-primary) !important;
}

/* Completely disable all hover effects for contact modal form inputs */
#contactModal .form-control:hover,
#contactModal input[type="text"]:hover,
#contactModal input[type="email"]:hover,
#contactModal textarea:hover {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    transform: none !important;
    box-shadow: none !important;
}

#contactModal .form-control::placeholder,
#contactModal input[type="text"]::placeholder,
#contactModal input[type="email"]::placeholder,
#contactModal textarea::placeholder {
    color: var(--text-secondary) !important;
}

#contactModal textarea.form-control,
#contactModal textarea {
    resize: none !important;
    height: 100px !important;
    min-height: 100px !important;
}

/* Ensure close button is visible and functional */
#contactModal .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23000%27%3e%3cpath d=%27M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z%27/%3e%3c/svg%3e") !important;
    background-size: 16px !important;
    opacity: 0.7 !important;
    filter: none !important;
}

/* Completely disable all hover effects for contact modal close button */
#contactModal .btn-close:hover,
#contactModal .btn-close:active,
#contactModal .btn-close:focus {
    opacity: 0.7 !important;
    transform: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Hover effect removed from close button */

/* Modal backdrop styling */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Ensure form is interactive */
#contactForm {
    position: relative !important;
    z-index: 10003 !important;
}

#contactForm .form-control,
#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm textarea {
    pointer-events: auto !important;
    user-select: text !important;
    cursor: text !important;
    background: #ffffff !important;
    color: #1e293b !important;
}

/* Additional fixes for modal functionality */
.modal.show {
    display: block !important;
}

.modal.fade.show {
    opacity: 1 !important;
}

/* Ensure modal is above everything */
#contactModal.modal {
    z-index: 9999 !important;
}

/* Fix any potential Bootstrap modal conflicts */
.modal-backdrop.show {
    opacity: 0.5 !important;
}

/* Remove any potential overlay issues */
#contactModal::before,
#contactModal::after {
    display: none !important;
}

/* Override any global form control styles that might affect the modal */
#contactModal .form-control,
#contactModal input,
#contactModal textarea {
    /* Reset any inherited styles */
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
    opacity: 1 !important;
    /* Ensure text is selectable and editable */
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* Specific overrides for different input types */
#contactModal input[type="text"],
#contactModal input[type="email"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
}

#contactModal textarea {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
}

/* Ensure focus states work properly */
#contactModal .form-control:focus,
#contactModal input:focus,
#contactModal textarea:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Responsive Status Bar */
@media (max-width: 768px) {

    
    .app-container {
        grid-template-rows: auto 1fr auto;
    }
}

@media (max-width: 480px) {

    
    .btn-outline-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
} 



/* Delete mode styling */
.delete-mode-active .vertex {
    position: relative;
}

.delete-button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

.delete-button:hover {
    background: #dc2626;
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.delete-button::before {
    content: "×";
    line-height: 1;
}

/* Delete mode canvas styling */
.delete-mode-active #graphCanvas {
    cursor: crosshair;
}

.delete-mode-active .vertex:hover {
    cursor: pointer;
}

/* Statistics section styling - more compact */
#infoSection {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#infoSection h3 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#infoSection h3 i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.stats-compact {
    display: flex;
    gap: 0.5rem;
    justify-content: space-around;
}

.stat-compact-item {
    text-align: center;
    padding: 0.375rem 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    min-width: 50px;
    transition: all 0.2s ease;
    flex: 1;
}

.stat-compact-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.stat-compact-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-compact-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Delete Mode Panel Styling */
#deleteModePanel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#deleteModePanel h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#deleteModePanel h3 i {
    color: #ef4444;
    font-size: 0.9rem;
}

.delete-mode-info {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.delete-mode-info-text {
    color: #ef4444;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

.selected-vertices-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.selected-vertex-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

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

.selected-vertex-item i {
    color: #ec4899;
    font-size: 0.8rem;
}

.selected-vertex-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.vertex-coords {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.coordinate-tooltip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.coordinate-tooltip-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.coordinate-tooltip-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.coordinate-toggle-container {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.coordinate-toggle-container .switch-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
}

.coordinate-toggle-container .switch-label i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.coordinate-grid-controls {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.coordinate-grid-toggle {
    margin-bottom: 1rem;
}

.coordinate-grid-toggle .switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.coordinate-grid-toggle .switch-label:hover {
    color: var(--text-primary);
}

.coordinate-grid-toggle .switch-label i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.coordinate-grid-density {
    margin-top: 0.75rem;
}

.coordinate-grid-density label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.coordinate-grid-density label i {
    color: var(--accent-color);
}









/* Image Format Buttons - Adjacent Style */
.image-format-buttons {
    display: flex;
    gap: 0;
    margin-top: 0.5rem;
}

.format-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.format-option input[type="radio"] {
    display: none;
}

.format-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.format-option:first-child .format-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: 1px solid var(--border-color);
}

.format-option:last-child .format-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-left: none;
}

.format-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.format-option input[type="radio"]:checked + .format-button {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.format-option input[type="radio"]:checked + .format-button i {
    opacity: 1;
    color: white;
}

.format-button:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.format-option input[type="radio"]:checked + .format-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Edge Type Buttons - Adjacent Style */
.edge-type-buttons {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
    width: 100%;
}

.edge-type-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-type-option input[type="radio"] {
    display: none;
}

.edge-type-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}



.edge-type-option:first-child .edge-type-button {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.edge-type-option:last-child .edge-type-button {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.edge-type-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-type-option input[type="radio"]:checked + .edge-type-button {
    background: linear-gradient(90deg, #4f46e5, #3730a3);
    border: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.edge-type-option input[type="radio"]:checked + .edge-type-button i {
    opacity: 1;
    color: white;
}

.edge-type-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



.edge-type-option input[type="radio"]:checked + .edge-type-button:hover {
    background: linear-gradient(90deg, #3730a3, #1e1b4b);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Visibility Buttons - Independent Toggle Style */
.visibility-buttons {
    display: flex;
    gap: 0;
    margin-top: 0.5rem;
}

.visibility-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.visibility-option input[type="checkbox"] {
    display: none;
}

.visibility-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, #818cf8, #6366f1); /* purple gradient */
    border: 1px solid #374151;
    border-radius: 0;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Remove background transition */
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
    position: relative;
    overflow: hidden;
}

.visibility-option input[type="checkbox"]:checked + .visibility-button {
    background: linear-gradient(90deg, #6366f1, #4f46e5); /* darker purple when active */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.visibility-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5); /* darker purple on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.visibility-option input[type="checkbox"]:checked + .visibility-button:hover {
    background: linear-gradient(90deg, #4f46e5, #4338ca); /* even darker purple on hover when checked */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.5);
}

.visibility-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.visibility-option:first-child .visibility-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: 1px solid var(--border-color);
}

.visibility-option:last-child .visibility-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-left: none;
}

.visibility-button i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
    opacity: 0.7;
}

.visibility-option input[type="checkbox"]:checked + .visibility-button i {
    opacity: 1;
}

.visibility-button:hover::before {
    left: 100%;
}

/* Edge Style Buttons - Adjacent Style */
.edge-style-buttons {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.edge-style-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-style-option input[type="radio"] {
    display: none;
}

.edge-style-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.edge-style-option:first-child .edge-style-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.edge-style-option:last-child .edge-style-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.edge-style-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    border-width: 3px;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.3);
    font-weight: 600;
    background-image: linear-gradient(45deg, transparent 30%, rgba(139, 92, 246, 0.05) 30%, rgba(139, 92, 246, 0.05) 70%, transparent 70%);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button i {
    opacity: 1;
    color: var(--primary-color);
}

.edge-style-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
}

/* Edge Direction Buttons - Adjacent Style */
.edge-direction-buttons {
    display: inline-flex;
    gap: 2px;
    margin-top: 0.5rem;
    /* width: 100%; */
}

.edge-direction-option {
    /* flex: 1; */
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-direction-option input[type="radio"] {
    display: none;
}

.edge-direction-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.edge-direction-option:first-child .edge-direction-button {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.edge-direction-option:last-child .edge-direction-button {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.edge-direction-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-direction-option input[type="radio"]:checked + .edge-direction-button {
    background: linear-gradient(90deg, #4f46e5, #3730a3);
    border: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.edge-direction-option input[type="radio"]:checked + .edge-direction-button i {
    opacity: 1;
    color: white;
}

.edge-direction-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



.edge-direction-option input[type="radio"]:checked + .edge-direction-button:hover {
    background: linear-gradient(90deg, #3730a3, #1e1b4b);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



/* Panel Drag and Drop Styles */
.draggable-panel {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    /* Ensure proper initial positioning */
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.draggable-panel:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 0 8px rgba(99, 102, 241, 0.4),
        0 0 15px rgba(99, 102, 241, 0.25),
        0 0 25px rgba(99, 102, 241, 0.15),
        0 0 35px rgba(99, 102, 241, 0.08),
        inset 0 0 25px rgba(99, 102, 241, 0.03),
        var(--shadow-lg);
    animation: laserGlow 2s ease-in-out infinite;
}

.draggable-panel.dragging {
    transition: none !important;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    animation: dragShake 0.1s ease-in-out infinite;
}

@keyframes dragShake {
    0% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(-1px) translateY(-1px); }
    50% { transform: translateX(1px) translateY(1px); }
    75% { transform: translateX(-1px) translateY(1px); }
    100% { transform: translateX(0px) translateY(0px); }
}

/* Alternative shake effect with more variation */
@keyframes dragShakeVariant {
    0% { transform: translateX(0px) translateY(0px); }
    20% { transform: translateX(-1px) translateY(0px); }
    40% { transform: translateX(1px) translateY(-1px); }
    60% { transform: translateX(0px) translateY(1px); }
    80% { transform: translateX(-1px) translateY(-1px); }
    100% { transform: translateX(0px) translateY(0px); }
}

@keyframes laserGlow {
    0% {
        box-shadow: 
            0 0 8px rgba(99, 102, 241, 0.4),
            0 0 15px rgba(99, 102, 241, 0.25),
            0 0 25px rgba(99, 102, 241, 0.15),
            0 0 35px rgba(99, 102, 241, 0.08),
            inset 0 0 25px rgba(99, 102, 241, 0.03),
            var(--shadow-lg);
    }
    50% {
        box-shadow: 
            0 0 12px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.35),
            0 0 30px rgba(99, 102, 241, 0.25),
            0 0 40px rgba(99, 102, 241, 0.12),
            inset 0 0 30px rgba(99, 102, 241, 0.05),
            var(--shadow-lg);
    }
    100% {
        box-shadow: 
            0 0 8px rgba(99, 102, 241, 0.4),
            0 0 15px rgba(99, 102, 241, 0.25),
            0 0 25px rgba(99, 102, 241, 0.15),
            0 0 35px rgba(99, 102, 241, 0.08),
            inset 0 0 25px rgba(99, 102, 241, 0.03),
            var(--shadow-lg);
    }
}

.panel-drag-handle {
    cursor: pointer !important;
    user-select: none;
    transition: background-color 0.2s ease;
    background-color: transparent;
    border-radius: var(--radius-sm);
    position: relative;
}

.panel-drag-handle:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.panel-drag-handle:active {
    cursor: grabbing !important;
    background-color: rgba(99, 102, 241, 0.08);
}

/* Visual feedback for clickable panels */
.panel-drag-handle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    z-index: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.02) 100%);
    opacity: 0;
}

.panel-drag-handle:hover::after {
    opacity: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Click feedback animation */
.panel-drag-handle:active::after {
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.1) 100%);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Hold feedback - shows when user is holding down but not yet dragging */
.panel-drag-handle.holding::after {
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.08) 100%);
    opacity: 1;
    animation: holdPulse 0.3s ease-in-out;
}

.panel-drag-handle.holding {
    transform: scale(0.99);
    transition: transform 0.1s ease;
}

@keyframes holdPulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* Make expand/collapse button non-draggable with 5px border */
.panel-drag-handle .expand-icon {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    padding: 5px;
    margin: -5px;
    border-radius: 4px;
}

.panel-drag-handle .expand-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Panel header container */
.panel-header-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.edit-mode-toggle {
    margin-left: auto;
}

/* Drag handle area */
.drag-handle-area {
    flex-shrink: 0;
    cursor: grab;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin-left: 3px;
    margin-top: -8px;
    min-width: 2rem;
    width: 2rem;
}

.drag-handle-area:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Drag handle icon styling */
.drag-handle-icon {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.2s ease;
    display: block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.drag-handle-area:hover .drag-handle-icon {
    opacity: 1;
    color: var(--text-primary);
}

/* Adjust drag handle position for Controls and Algorithms panels */
#basicControlsSection .drag-handle-area {
    margin-top: -12px;
}

#searchSection .drag-handle-area {
    margin-top: -12px;
}

/* Adjust title position for Controls and Algorithms panels */
#basicControlsSection .expandable-header {
    transform: translateY(3px);
}

#searchSection .expandable-header {
    transform: translateY(3px);
}



/* Drop preview styles */
.drop-preview {
    animation: dropPreviewPulse 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.drop-preview:hover {
    transform: scale(1.02);
}

.drop-indicator {
    animation: dropIndicatorFade 1.5s ease-in-out infinite;
}

@keyframes dropPreviewPulse {
    0% { 
        background-color: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    50% { 
        background-color: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.8);
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    }
    100% { 
        background-color: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

@keyframes dropIndicatorFade {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}



/* Ensure proper spacing between panels */
.draggable-panel + .draggable-panel {
    margin-top: 1rem;
}

/* Animation for panel reordering */
.sidebar-content {
    transition: none;
}

.sidebar-content.reordering {
    transition: all 0.3s ease;
}

/* Panel drag styling */
.panel-drag-handle {
    position: relative;
}

/* Ensure interactive elements stay above the drag overlay */
.panel-drag-handle button,
.panel-drag-handle input,
.panel-drag-handle select,
.panel-drag-handle textarea,
.panel-drag-handle a,
.panel-drag-handle label,
.panel-drag-handle .control-group,
.panel-drag-handle .button-group,
.panel-drag-handle .slider-container,
.panel-drag-handle .checkbox-label,
.panel-drag-handle .checkmark {
    position: relative;
    z-index: 2;
}

/* Prevent text selection during drag */
.draggable-panel.dragging * {
    user-select: none;
}

/* Visual feedback for draggable panels - moved to header */


/* Ensure panels maintain their expanded/collapsed state during drag */
.draggable-panel .expandable-content {
    transition: none;
}

.draggable-panel.dragging .expandable-content {
    transition: none !important;
}





/* Ensure right sidebar panels have proper spacing */
.right-sidebar .draggable-panel + .draggable-panel {
    margin-top: 1rem;
}

/* Add styles for select options to make them smaller */
.control-group select option {
    font-size: 0.75rem;
}

.control-group select {
    font-size: 0.875rem;
}

.btn-magenta {
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: 1px solid #4f46e5;
    color: white;
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
}

.btn-magenta:hover:not(:disabled) {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    border-color: #4338ca;
    box-shadow: 0 4px 8px rgba(129, 140, 248, 0.4);
    transform: translateY(-1px);
}

.btn-magenta:active:not(:disabled) {
    background: linear-gradient(90deg, #4f46e5, #4338ca);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
}

.root-vertex-display {
    position: relative;
}

.root-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    transition: var(--transition);
    overflow: hidden; /* Prevent content from overflowing */
}

.root-display.has-root {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.root-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.root-vertex-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Cancel button styling for edit and delete modes */
#cancelVertexEdit,
#cancelDeleteChanges {
    background: linear-gradient(90deg, #f87171, #ef4444) !important;
    color: white !important;
    border: none !important;
}

#cancelVertexEdit:hover:not(:disabled),
#cancelDeleteChanges:hover:not(:disabled) {
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white !important;
}

/* Additional critical fixes for contact modal form inputs */
#contactModal input[type="text"],
#contactModal input[type="email"],
#contactModal textarea {
    /* Override any potential inherited styles */
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
    opacity: 1 !important;
    /* Ensure text is selectable and editable */
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    /* Override any potential disabled states */
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    /* Ensure proper sizing */
    box-sizing: border-box !important;
    /* Override any potential inherited font styles */
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Override any potential Bootstrap form control styles */
#contactModal .form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
    opacity: 1 !important;
}

/* Ensure the modal backdrop doesn't interfere with form inputs */
.modal-backdrop {
    pointer-events: none !important;
}

.modal-backdrop.show {
    pointer-events: none !important;
}

/* Override any potential global input styles */
#contactModal input,
#contactModal textarea {
    /* Reset any inherited styles that might cause issues */
    margin: 0 !important;
    padding: 0.75rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    outline: none !important;
    /* Ensure proper display */
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Specific fixes for different input types */
#contactModal input[type="text"] {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

#contactModal input[type="email"] {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

#contactModal textarea {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Ensure focus states override any global styles */
#contactModal .form-control:focus,
#contactModal input:focus,
#contactModal textarea:focus {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    outline: none !important;
}

/* Responsive Status Bar */
@media (max-width: 768px) {

    
    .app-container {
        grid-template-rows: auto 1fr auto;
    }
}

@media (max-width: 480px) {

    
    .btn-outline-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
} 



/* Delete mode styling */
.delete-mode-active .vertex {
    position: relative;
}

.delete-button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

.delete-button:hover {
    background: #dc2626;
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.delete-button::before {
    content: "×";
    line-height: 1;
}

/* Delete mode canvas styling */
.delete-mode-active #graphCanvas {
    cursor: crosshair;
}

.delete-mode-active .vertex:hover {
    cursor: pointer;
}

/* Statistics section styling - more compact */
#infoSection {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#infoSection h3 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#infoSection h3 i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.stats-compact {
    display: flex;
    gap: 0.5rem;
    justify-content: space-around;
}

.stat-compact-item {
    text-align: center;
    padding: 0.375rem 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    min-width: 50px;
    transition: all 0.2s ease;
    flex: 1;
}

.stat-compact-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.stat-compact-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-compact-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Delete Mode Panel Styling */
#deleteModePanel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#deleteModePanel h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#deleteModePanel h3 i {
    color: #ef4444;
    font-size: 0.9rem;
}

.delete-mode-info {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.delete-mode-info-text {
    color: #ef4444;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

.selected-vertices-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.selected-vertex-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

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

.selected-vertex-item i {
    color: #ec4899;
    font-size: 0.8rem;
}

.selected-vertex-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.vertex-coords {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.coordinate-tooltip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.coordinate-tooltip-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.coordinate-tooltip-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.coordinate-toggle-container {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.coordinate-toggle-container .switch-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
}

.coordinate-toggle-container .switch-label i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.coordinate-grid-controls {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.coordinate-grid-toggle {
    margin-bottom: 1rem;
}

.coordinate-grid-toggle .switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.coordinate-grid-toggle .switch-label:hover {
    color: var(--text-primary);
}

.coordinate-grid-toggle .switch-label i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.coordinate-grid-density {
    margin-top: 0.75rem;
}

.coordinate-grid-density label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.coordinate-grid-density label i {
    color: var(--accent-color);
}









/* Image Format Buttons - Adjacent Style */
.image-format-buttons {
    display: flex;
    gap: 0;
    margin-top: 0.5rem;
}

.format-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.format-option input[type="radio"] {
    display: none;
}

.format-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.format-option:first-child .format-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: 1px solid var(--border-color);
}

.format-option:last-child .format-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-left: none;
}

.format-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.format-option input[type="radio"]:checked + .format-button {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.format-option input[type="radio"]:checked + .format-button i {
    opacity: 1;
    color: white;
}

.format-button:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.format-option input[type="radio"]:checked + .format-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Edge Type Buttons - Adjacent Style */
.edge-type-buttons {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
    width: 100%;
}

.edge-type-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-type-option input[type="radio"] {
    display: none;
}

.edge-type-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}



.edge-type-option:first-child .edge-type-button {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.edge-type-option:last-child .edge-type-button {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.edge-type-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-type-option input[type="radio"]:checked + .edge-type-button {
    background: linear-gradient(90deg, #4f46e5, #3730a3);
    border: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.edge-type-option input[type="radio"]:checked + .edge-type-button i {
    opacity: 1;
    color: white;
}

.edge-type-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



.edge-type-option input[type="radio"]:checked + .edge-type-button:hover {
    background: linear-gradient(90deg, #3730a3, #1e1b4b);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Visibility Buttons - Independent Toggle Style */
.visibility-buttons {
    display: flex;
    gap: 0;
    margin-top: 0.5rem;
}

.visibility-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.visibility-option input[type="checkbox"] {
    display: none;
}

.visibility-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, #818cf8, #6366f1); /* purple gradient */
    border: 1px solid #374151;
    border-radius: 0;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Remove background transition */
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
    position: relative;
    overflow: hidden;
}

.visibility-option input[type="checkbox"]:checked + .visibility-button {
    background: linear-gradient(90deg, #6366f1, #4f46e5); /* darker purple when active */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.visibility-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5); /* darker purple on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.visibility-option input[type="checkbox"]:checked + .visibility-button:hover {
    background: linear-gradient(90deg, #4f46e5, #4338ca); /* even darker purple on hover when checked */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.5);
}

.visibility-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.visibility-option:first-child .visibility-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: 1px solid var(--border-color);
}

.visibility-option:last-child .visibility-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-left: none;
}

.visibility-button i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
    opacity: 0.7;
}

.visibility-option input[type="checkbox"]:checked + .visibility-button i {
    opacity: 1;
}

.visibility-button:hover::before {
    left: 100%;
}

/* Edge Style Buttons - Adjacent Style */
.edge-style-buttons {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.edge-style-option {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-style-option input[type="radio"] {
    display: none;
}

.edge-style-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.edge-style-option:first-child .edge-style-button {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.edge-style-option:last-child .edge-style-button {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.edge-style-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    border-width: 3px;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.3);
    font-weight: 600;
    background-image: linear-gradient(45deg, transparent 30%, rgba(139, 92, 246, 0.05) 30%, rgba(139, 92, 246, 0.05) 70%, transparent 70%);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button i {
    opacity: 1;
    color: var(--primary-color);
}

.edge-style-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edge-style-option input[type="radio"]:checked + .edge-style-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
}

/* Edge Direction Buttons - Adjacent Style */
.edge-direction-buttons {
    display: inline-flex;
    gap: 2px;
    margin-top: 0.5rem;
    /* width: 100%; */
}

.edge-direction-option {
    /* flex: 1; */
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.edge-direction-option input[type="radio"] {
    display: none;
}

.edge-direction-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.edge-direction-option:first-child .edge-direction-button {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.edge-direction-option:last-child .edge-direction-button {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.edge-direction-button i {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

.edge-direction-option input[type="radio"]:checked + .edge-direction-button {
    background: linear-gradient(90deg, #4f46e5, #3730a3);
    border: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.edge-direction-option input[type="radio"]:checked + .edge-direction-button i {
    opacity: 1;
    color: white;
}

.edge-direction-button:hover {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



.edge-direction-option input[type="radio"]:checked + .edge-direction-button:hover {
    background: linear-gradient(90deg, #3730a3, #1e1b4b);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}



/* Panel Drag and Drop Styles */
.draggable-panel {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    /* Ensure proper initial positioning */
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.draggable-panel:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 0 8px rgba(99, 102, 241, 0.4),
        0 0 15px rgba(99, 102, 241, 0.25),
        0 0 25px rgba(99, 102, 241, 0.15),
        0 0 35px rgba(99, 102, 241, 0.08),
        inset 0 0 25px rgba(99, 102, 241, 0.03),
        var(--shadow-lg);
    animation: laserGlow 2s ease-in-out infinite;
}

.draggable-panel.dragging {
    transition: none !important;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    animation: dragShake 0.1s ease-in-out infinite;
}

@keyframes dragShake {
    0% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(-1px) translateY(-1px); }
    50% { transform: translateX(1px) translateY(1px); }
    75% { transform: translateX(-1px) translateY(1px); }
    100% { transform: translateX(0px) translateY(0px); }
}

/* Alternative shake effect with more variation */
@keyframes dragShakeVariant {
    0% { transform: translateX(0px) translateY(0px); }
    20% { transform: translateX(-1px) translateY(0px); }
    40% { transform: translateX(1px) translateY(-1px); }
    60% { transform: translateX(0px) translateY(1px); }
    80% { transform: translateX(-1px) translateY(-1px); }
    100% { transform: translateX(0px) translateY(0px); }
}

@keyframes laserGlow {
    0% {
        box-shadow: 
            0 0 8px rgba(99, 102, 241, 0.4),
            0 0 15px rgba(99, 102, 241, 0.25),
            0 0 25px rgba(99, 102, 241, 0.15),
            0 0 35px rgba(99, 102, 241, 0.08),
            inset 0 0 25px rgba(99, 102, 241, 0.03),
            var(--shadow-lg);
    }
    50% {
        box-shadow: 
            0 0 12px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.35),
            0 0 30px rgba(99, 102, 241, 0.25),
            0 0 40px rgba(99, 102, 241, 0.12),
            inset 0 0 30px rgba(99, 102, 241, 0.05),
            var(--shadow-lg);
    }
    100% {
        box-shadow: 
            0 0 8px rgba(99, 102, 241, 0.4),
            0 0 15px rgba(99, 102, 241, 0.25),
            0 0 25px rgba(99, 102, 241, 0.15),
            0 0 35px rgba(99, 102, 241, 0.08),
            inset 0 0 25px rgba(99, 102, 241, 0.03),
            var(--shadow-lg);
    }
}

.panel-drag-handle {
    cursor: pointer !important;
    user-select: none;
    transition: background-color 0.2s ease;
    background-color: transparent;
    border-radius: var(--radius-sm);
    position: relative;
}

.panel-drag-handle:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.panel-drag-handle:active {
    cursor: grabbing !important;
    background-color: rgba(99, 102, 241, 0.08);
}

/* Visual feedback for clickable panels */
.panel-drag-handle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    z-index: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.02) 100%);
    opacity: 0;
}

.panel-drag-handle:hover::after {
    opacity: 1;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Click feedback animation */
.panel-drag-handle:active::after {
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.1) 100%);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Hold feedback - shows when user is holding down but not yet dragging */
.panel-drag-handle.holding::after {
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.08) 100%);
    opacity: 1;
    animation: holdPulse 0.3s ease-in-out;
}

.panel-drag-handle.holding {
    transform: scale(0.99);
    transition: transform 0.1s ease;
}

@keyframes holdPulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* Make expand/collapse button non-draggable with 5px border */
.panel-drag-handle .expand-icon {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    padding: 5px;
    margin: -5px;
    border-radius: 4px;
}

.panel-drag-handle .expand-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Panel header container */
.panel-header-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.edit-mode-toggle {
    margin-left: auto;
}

/* Drag handle area */
.drag-handle-area {
    flex-shrink: 0;
    cursor: grab;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin-left: 3px;
    margin-top: -8px;
    min-width: 2rem;
    width: 2rem;
}

.drag-handle-area:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Drag handle icon styling */
.drag-handle-icon {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.2s ease;
    display: block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.drag-handle-area:hover .drag-handle-icon {
    opacity: 1;
    color: var(--text-primary);
}

/* Adjust drag handle position for Controls and Algorithms panels */
#basicControlsSection .drag-handle-area {
    margin-top: -12px;
}

#searchSection .drag-handle-area {
    margin-top: -12px;
}

/* Adjust title position for Controls and Algorithms panels */
#basicControlsSection .expandable-header {
    transform: translateY(3px);
}

#searchSection .expandable-header {
    transform: translateY(3px);
}



/* Drop preview styles */
.drop-preview {
    animation: dropPreviewPulse 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.drop-preview:hover {
    transform: scale(1.02);
}

.drop-indicator {
    animation: dropIndicatorFade 1.5s ease-in-out infinite;
}

@keyframes dropPreviewPulse {
    0% { 
        background-color: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    50% { 
        background-color: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.8);
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    }
    100% { 
        background-color: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

@keyframes dropIndicatorFade {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}



/* Ensure proper spacing between panels */
.draggable-panel + .draggable-panel {
    margin-top: 1rem;
}

/* Animation for panel reordering */
.sidebar-content {
    transition: none;
}

.sidebar-content.reordering {
    transition: all 0.3s ease;
}

/* Panel drag styling */
.panel-drag-handle {
    position: relative;
}

/* Ensure interactive elements stay above the drag overlay */
.panel-drag-handle button,
.panel-drag-handle input,
.panel-drag-handle select,
.panel-drag-handle textarea,
.panel-drag-handle a,
.panel-drag-handle label,
.panel-drag-handle .control-group,
.panel-drag-handle .button-group,
.panel-drag-handle .slider-container,
.panel-drag-handle .checkbox-label,
.panel-drag-handle .checkmark {
    position: relative;
    z-index: 2;
}

/* Prevent text selection during drag */
.draggable-panel.dragging * {
    user-select: none;
}

/* Visual feedback for draggable panels - moved to header */


/* Ensure panels maintain their expanded/collapsed state during drag */
.draggable-panel .expandable-content {
    transition: none;
}

.draggable-panel.dragging .expandable-content {
    transition: none !important;
}





/* Ensure right sidebar panels have proper spacing */
.right-sidebar .draggable-panel + .draggable-panel {
    margin-top: 1rem;
}

/* Add styles for select options to make them smaller */
.control-group select option {
    font-size: 0.75rem;
}

.control-group select {
    font-size: 0.875rem;
}

.btn-magenta {
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border: 1px solid #4f46e5;
    color: white;
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
}

.btn-magenta:hover:not(:disabled) {
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    border-color: #4338ca;
    box-shadow: 0 4px 8px rgba(129, 140, 248, 0.4);
    transform: translateY(-1px);
}

.btn-magenta:active:not(:disabled) {
    background: linear-gradient(90deg, #4f46e5, #4338ca);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(129, 140, 248, 0.3);
}

.root-vertex-display {
    position: relative;
}

.root-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    transition: var(--transition);
    overflow: hidden; /* Prevent content from overflowing */
}

.root-display.has-root {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.root-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.root-vertex-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Cancel button styling for edit and delete modes */
#cancelVertexEdit,
#cancelDeleteChanges {
    background: linear-gradient(90deg, #f87171, #ef4444) !important;
    color: white !important;
    border: none !important;
}

#cancelVertexEdit:hover:not(:disabled),
#cancelDeleteChanges:hover:not(:disabled) {
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white !important;
}

/* Additional critical fixes for contact modal form inputs */
#contactModal input[type="text"],
#contactModal input[type="email"],
#contactModal textarea {
    /* Override any potential inherited styles */
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
    opacity: 1 !important;
    /* Ensure text is selectable and editable */
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    /* Override any potential disabled states */
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    /* Ensure proper sizing */
    box-sizing: border-box !important;
    /* Override any potential inherited font styles */
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Override any potential Bootstrap form control styles */
#contactModal .form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
    opacity: 1 !important;
}

/* Ensure the modal backdrop doesn't interfere with form inputs */
.modal-backdrop {
    pointer-events: none !important;
}

.modal-backdrop.show {
    pointer-events: none !important;
}

/* Override any potential global input styles */
#contactModal input,
#contactModal textarea {
    /* Reset any inherited styles that might cause issues */
    margin: 0 !important;
    padding: 0.75rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    outline: none !important;
    /* Ensure proper display */
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Specific fixes for different input types */
#contactModal input[type="text"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
}

#contactModal input[type="email"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
}

#contactModal textarea {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    resize: none !important;
    height: 100px !important;
    min-height: 100px !important;
}

/* Ensure focus states override any global styles */
#contactModal input:focus,
#contactModal textarea:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Override any potential placeholder styles */
#contactModal input::placeholder,
#contactModal textarea::placeholder {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
}

/* Ensure the modal content is above any potential overlays */
#contactModal .modal-content {
    position: relative !important;
    z-index: 10001 !important;
    background: var(--bg-secondary) !important;
}

/* Fix any potential form label issues */
#contactModal .form-label {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Ensure buttons in the modal are properly styled */
#contactModal .btn {
    background: var(--primary-color) !important;
    color: var(--text-primary) !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

/* Hover effect removed from primary button */

#contactModal .btn-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Hover effect removed from secondary button */

/* Final critical fixes to ensure contact modal works perfectly */
#contactModal {
    /* Ensure modal is above everything */
    z-index: 9999 !important;
    position: fixed !important;
}

#contactModal .modal-dialog {
    z-index: 10000 !important;
}

#contactModal .modal-content {
    z-index: 10001 !important;
    position: relative !important;
}

/* Override any potential global form styles */
#contactModal form {
    position: relative !important;
    z-index: 10002 !important;
}

/* Ensure form inputs are completely isolated from global styles */
#contactModal .form-control,
#contactModal input[type="text"],
#contactModal input[type="email"],
#contactModal textarea {
    /* Force override any inherited styles */
    all: unset !important;
    /* Re-apply our specific styles */
    display: block !important;
    width: 100% !important;
    padding: 0.75rem !important;
    margin: 0 !important;
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    /* Ensure interactivity */
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    /* Remove any potential disabled appearance */
    opacity: 1 !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    /* Ensure proper focus behavior */
    outline: none !important;
    /* Disable all transitions and animations */
    transition: none !important;
    animation: none !important;
}

/* Override any potential Bootstrap form-control styles */
#contactModal .form-control {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Ensure focus states work properly */
#contactModal .form-control:focus,
#contactModal input[type="text"]:focus,
#contactModal input[type="email"]:focus,
#contactModal textarea:focus {
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    outline: none !important;
}

/* Override any potential placeholder styles */
#contactModal .form-control::placeholder,
#contactModal input[type="text"]::placeholder,
#contactModal input[type="email"]::placeholder,
#contactModal textarea::placeholder {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
}

/* Ensure textarea has proper height */
#contactModal textarea.form-control,
#contactModal textarea {
    resize: none !important;
    height: 100px !important;
    min-height: 100px !important;
}

/* Override any potential global button styles */
#contactModal .btn {
    all: unset !important;
    display: inline-block !important;
    padding: 0.5rem 1rem !important;
    margin: 0.25rem !important;
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* Completely disable all hover effects for contact modal buttons */
#contactModal .btn:hover,
#contactModal .btn:hover:not(:disabled),
#contactModal .btn:active,
#contactModal .btn:focus {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Override global button hover effects specifically for contact modal */
#contactModal .btn-primary:hover,
#contactModal .btn-primary:hover:not(:disabled),
#contactModal .btn-primary:active,
#contactModal .btn-primary:focus {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Override any gradient backgrounds on hover */
#contactModal .btn-primary:hover,
#contactModal .btn-primary:hover:not(:disabled) {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
    background-gradient: none !important;
}

/* Ultra-specific override for the Send Message button */
#contactModal button[form="contactForm"]:hover,
#contactModal button[form="contactForm"]:hover:not(:disabled),
#contactModal button[form="contactForm"]:active,
#contactModal button[form="contactForm"]:focus {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Override any inherited button styles */
#contactModal button[type="submit"]:hover,
#contactModal button[type="submit"]:hover:not(:disabled),
#contactModal button[type="submit"]:active,
#contactModal button[type="submit"]:focus {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Nuclear option: Override ALL button hover effects in contact modal */
#contactModal button:hover,
#contactModal button:hover:not(:disabled),
#contactModal button:active,
#contactModal button:focus,
#contactModal .btn:hover,
#contactModal .btn:hover:not(:disabled),
#contactModal .btn:active,
#contactModal .btn:focus {
    background: inherit !important;
    background-color: inherit !important;
    background-image: none !important;
    color: inherit !important;
    border: inherit !important;
    transform: none !important;
    box-shadow: inherit !important;
    text-shadow: inherit !important;
    transition: none !important;
    animation: none !important;
}

/* Hover effects removed from contact panel buttons */

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

/* Completely disable all hover effects for contact modal secondary buttons */
#contactModal .btn-secondary:hover,
#contactModal .btn-secondary:hover:not(:disabled),
#contactModal .btn-secondary:active,
#contactModal .btn-secondary:focus {
    background: var(--bg-tertiary) !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Ensure modal backdrop doesn't interfere */
.modal-backdrop {
    pointer-events: none !important;
    z-index: 9998 !important;
}

.modal-backdrop.show {
    pointer-events: none !important;
}

/* Override any potential global modal styles */
#contactModal.modal {
    z-index: 9999 !important;
}

#contactModal.modal.show {
    display: block !important;
}

#contactModal.modal.fade.show {
    opacity: 1 !important;
}

/* Ensure form labels are properly styled */
#contactModal .form-label {
    all: unset !important;
    display: block !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Override any potential global input styles */
#contactModal input,
#contactModal textarea {
    /* Force override any inherited styles */
    all: unset !important;
    /* Re-apply our specific styles */
    display: block !important;
    width: 100% !important;
    padding: 0.75rem !important;
    margin: 0 !important;
    background: var(--bg-primary) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    opacity: 1 !important;
}

/* Remove Autocomplete background color on Chrome */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
    background-color: transparent !important;
    -webkit-appearance: none;
    appearance: none;
}

/* ... existing code ... */
#contactModal .btn-primary:hover,
#contactModal .btn-primary:hover:not(:disabled) {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
}

/* Ultra-specific override for the Send Message button */
#contactModal .modal-footer .btn-primary {
    background: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

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

/* Additional autofill prevention */
#contactModal input,
#contactModal textarea {
    -webkit-autocomplete: off !important;
    -moz-autocomplete: off !important;
}

/* Enhanced form spacing */
.contact-form-section .form-label {
    /* ... existing code ... */
}
