/* add-bolts-editor.css - Page Specific Styles */

.search-highlight {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}
.resize-handle {
    fill: #ef4444;
    stroke: black;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    cursor: nwse-resize;
}
.rotation-handle {
    fill: #3b82f6;
    stroke: #60a5fa;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    cursor: alias;
}
.sidebar-bolt-menu {
    transition: max-height 0.5s ease-in-out, border-color 0.3s, box-shadow 0.3s;
    max-height: 50px;
    overflow: hidden;
    background-color: var(--gray-800);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-700);
}
.sidebar-bolt-menu.expanded { max-height: 600px; }
.sidebar-bolt-menu.no-positioning {
    border-left: 4px solid var(--yellow-400);
    background-color: rgba(250, 204, 21, 0.1);
}
.sidebar-bolt-menu.has-positioning {
    border-left: 4px solid var(--blue-500);
}
#svg-container:active { cursor: grabbing; }

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
}
.bike-info-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
}

.bike-info-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.bike-info-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
}

.bike-info-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-400);
    text-align: center;
}

.bike-model-no {
    color: var(--gray-400);
}

.bike-info-separator {
    color: var(--gray-500);
    font-weight: bold;
}

.bike-source-link {
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.2s ease;
}

.bike-source-link:hover {
    color: var(--white);
    text-decoration: underline;
}

.edit-bike-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.edit-bike-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}
.back-button {
    background-color: var(--gray-700);
    color: var(--white);
    border: 1px solid var(--gray-600);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.back-button:hover {
    background-color: var(--gray-600);
}
.form-input {
    background-color: var(--gray-700);
    border: 1px solid var(--gray-600);
    border-radius: 0.25rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    color: #e5e7eb;
    text-align: center;
}
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--blue-500);
    border-color: var(--blue-500);
}
.form-input::placeholder {
    color: var(--gray-400);
    opacity: 0.8;
}
.bike-info-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
}
.button-primary {
    background-color: var(--blue-600);
    color: var(--white);
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
}
.button-primary:hover {
    background-color: var(--blue-700);
}
.page-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.page-header {
    flex-shrink: 0;
    height: auto;
}

.toolbar-nav {
    flex-shrink: 0;
}

.content-section {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.svg-viewer-main {
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-800);
    overflow: hidden;
    position: relative;
    touch-action: none;
}
.svg-container-div {
    width: 100%;
    height: 100%;
}
.sidebar {
    width: 18rem;
    min-width: 15rem;
    max-width: 25rem;
    background-color: var(--gray-900);
    padding: 1rem;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    border-left: 1px solid var(--gray-700);
    overflow-x: hidden;
    position: relative;
    flex-shrink: 0;
}
.sidebar-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 1000;
}
.sidebar-resize-handle:hover {
    background: rgba(59, 130, 246, 0.3);
}
.sidebar.resizing {
    pointer-events: none;
    user-select: none;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.search-wrapper { margin-bottom: 1rem; }
.full-width { width: 100%; box-sizing: border-box; }
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
}
.menu-title {
    font-weight: 600;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}
.menu-chevron { transition: transform 0.3s; }
.menu-content {
    margin-top: 1rem;
    border-top: 1px solid var(--gray-700);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-label {
    font-size: 0.75rem;
}
.sidebar-form-input {
    margin-top: 0.25rem;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--gray-700);
    border: 1px solid var(--gray-600);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: #e5e7eb;
}
.sidebar-form-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--blue-500);
}
.main-bolt-card {
    background-color: var(--gray-800);
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid var(--gray-600);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.main-bolt-card.active {
    background-color: var(--gray-700);
}
/* Small attach mode indicator next to keyboard button */
.attach-mode-indicator-small {
    background-color: var(--yellow-400);
    color: var(--gray-900);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer cards in attach mode */
.footer-bolt-card.detached.attach-mode-footer {
    border-color: var(--yellow-400);
    background-color: rgba(250, 204, 21, 0.1);
    box-shadow: 0 2px 4px -1px rgb(250 204 21 / 0.25);
    position: relative;
}

.attach-circle-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--yellow-400);
    color: var(--gray-900);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid var(--gray-800);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
.footer {
    background-color: var(--gray-800);
    border-top: 2px solid var(--gray-700);
    padding: 1rem;
    height: 180px;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    position: relative;
    min-height: 140px;
    max-height: 50vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-shrink: 0;
}
.footer * {
    box-sizing: border-box;
}
.footer-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: transparent;
    cursor: row-resize;
    z-index: 1000;
}
.footer-resize-handle:hover {
    background: rgba(59, 130, 246, 0.3);
}
.footer.resizing {
    pointer-events: none;
    user-select: none;
}
.footer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 0;
}
.footer-bolt-grid {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    flex: 1;
    min-height: 0;
    align-items: flex-start;
}
.footer-bolt-card {
    background-color: var(--gray-700);
    border-radius: 6px;
    padding: 0.75rem;
    min-width: 160px;
    max-width: 200px;
    border: 1px solid var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    max-height: 120px;
}
.footer-bolt-card:hover {
    background-color: var(--gray-600);
    border-color: var(--blue-500);
}
.footer-bolt-card.selected {
    border-color: var(--blue-500);
    background-color: var(--blue-600);
    color: var(--white);
}
.footer-bolt-card.attach-mode-footer.detached.selected {
    background-color: #796b32;
}
.footer-bolt-card.search-highlight {
    border-color: var(--blue-500);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}
.footer-bolt-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.footer-bolt-status {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.footer-bolt-card.selected .footer-bolt-status {
    color: var(--gray-200);
}
.footer-bolt-torque {
    font-size: 0.75rem;
    color: var(--gray-300);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.footer-bolt-card.selected .footer-bolt-torque {
    color: var(--gray-100);
}
.nav-mode-toggle {
    background-color: var(--gray-700);
    color: var(--gray-300);
    border: 1px solid var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.nav-mode-toggle:hover {
    background-color: var(--gray-600);
    border-color: var(--blue-500);
}
.nav-mode-toggle.spatial-mode {
    background-color: var(--blue-600);
    color: var(--white);
    border-color: var(--blue-500);
}
.nav-mode-toggle.spatial-mode:hover {
    background-color: var(--blue-700);
}
.context-menu {
    position: fixed;
    background-color: var(--gray-800);
    border: 1px solid var(--gray-600);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    z-index: 10000;
    padding: 0.25rem 0;
    min-width: 150px;
    display: none;
}
.context-menu-item {
    padding: 0.5rem 0.75rem;
    color: var(--white);
    cursor: pointer;
    font-size: 0.875rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.context-menu-item:hover {
    background-color: var(--blue-600);
}
.context-menu-item:disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}
.context-menu-item:disabled:hover {
    background-color: transparent;
}
.context-menu-separator {
    height: 1px;
    background-color: var(--gray-600);
    margin: 0.25rem 0;
}
.main-bolt-card .card-header {
    display: flex;
    padding: 0px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.main-bolt-card .card-title {
    font-weight: 600;
    color: var(--white);
    margin: 0;
    font-size: 1rem;
}
.hotdog-menu {
    position: relative;
}
.hotdog-button {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}
.hotdog-button:hover {
    background-color: var(--gray-600);
    color: var(--white);
}
.hotdog-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--gray-800);
    border: 1px solid var(--gray-600);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 150px;
    display: none;
}
.hotdog-dropdown.show {
    display: block;
}
.hotdog-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--white);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}
.hotdog-dropdown button:hover {
    background-color: var(--gray-700);
}
.hotdog-dropdown button.danger {
    color: #ef4444;
}
.hotdog-dropdown button.danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}
.bolt-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.bolt-list h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bolt-count {
    font-size: 0.8em;
    color: var(--gray-400);
    font-weight: normal;
}
.bolt-list-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    background-color: var(--gray-700);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.bolt-list-item:hover {
    background-color: var(--gray-600);
}
.bolt-list-item.selected {
    background-color: var(--blue-600);
    border-color: var(--blue-500);
}
.bolt-list-item.pending-delete {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    opacity: 0.7;
}
.bolt-list-item .bolt-info {
    flex: 1;
    min-width: 0;
}
.bolt-list-item .bolt-name {
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-size: 0.9em;
}
.bolt-list-item .bolt-details {
    font-size: 0.75em;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0 0 0;
}
.bolt-list-item.pending-delete .bolt-name {
    text-decoration: line-through;
}
.delete-indicator {
    color: #ef4444;
    font-size: 0.9em;
    margin-left: 8px;
}
.torque-warning {
    color: var(--yellow-400);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
.radio-group {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
}
.radio-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}
.radio-input {
    margin-right: 0.5rem;
    background-color: var(--gray-700);
}
.bolt-status-indicator {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.25rem;
}
.bolt-status-associated {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--blue-400);
    border: 1px solid var(--blue-500);
}
.bolt-status-unassociated {
    background-color: rgba(250, 204, 21, 0.2);
    color: var(--yellow-400);
    border: 1px solid var(--yellow-400);
}
.attach-button {
    background-color: var(--yellow-400);
    color: var(--gray-900);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 150ms ease-in-out;
}
.attach-button:hover {
    background-color: var(--yellow-400);
    opacity: 0.8;
}
.attach-button.active {
    background-color: var(--red-600);
    color: white;
}
.attach-instructions {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
    font-style: italic;
}
.next-bolt-suggestion {
    background-color: rgba(250, 204, 21, 0.15);
    border: 1px solid var(--yellow-400);
}

/* Drive Size Input Container */
.drive-size-input-container {
    display: flex;
    align-items: center;
    background-color: var(--gray-700);
    border: 1px solid var(--gray-600);
    border-radius: 0.375rem;
    overflow: hidden;
    margin-top: 0.25rem;
    box-sizing: border-box;
}

.drive-size-input-container:focus-within {
    box-shadow: 0 0 0 1px var(--blue-500);
    border-color: var(--blue-500);
}

.drive-size-input {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: #e5e7eb;
    flex: 1;
    outline: none;
    min-width: 0;
}

.drive-size-input::placeholder {
    color: var(--gray-400);
    opacity: 0.8;
}

.drive-size-prefix,
.drive-size-suffix {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
    flex-shrink: 0;
}

.drive-size-prefix[data-prefix-type="torx"] {
    color: var(--blue-400);
    background-color: rgba(59, 130, 246, 0.1);
}

.drive-size-prefix[data-prefix-type="phillips"] {
    color: var(--green-400);
    background-color: rgba(34, 197, 94, 0.1);
}

.drive-size-prefix[data-prefix-type="flathead"] {
    color: var(--purple-400);
    background-color: rgba(168, 85, 247, 0.1);
}

.drive-size-suffix[data-suffix-type="hex"] {
    color: var(--gray-400);
    background-color: rgba(156, 163, 175, 0.1);
}

/* Custom mode styling */
.drive-size-input-container.custom-mode .drive-size-input {
    padding: 0.25rem 0.5rem;
}

.drive-size-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-override-checkbox {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-400);
    cursor: pointer;
    user-select: none;
}

.custom-override-checkbox input[type="checkbox"] {
    margin: 0;
    accent-color: var(--blue-500);
    cursor: pointer;
}

.custom-override-checkbox:hover .checkbox-label {
    color: var(--gray-300);
}