/* Collimation Trainer Styles */

/* Telescope type toggle buttons */
.collim-type-btn {
    background: #374151;
    color: #9ca3af;
    border: 1px solid #4b5563;
    cursor: pointer;
}

.collim-type-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.collim-type-btn.active {
    background: #1e40af;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Intra/Extra focal toggle group */
.collim-toggle-group {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.collim-toggle-btn {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}

.collim-toggle-btn:hover {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.05);
}

.collim-toggle-btn.active {
    background: #1e3a5f;
    color: #60a5fa;
}

/* Focus slider */
.collim-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 6px;
    background: #374151;
    border-radius: 3px;
    outline: none;
}

.collim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #1e3a5f;
}

.collim-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #1e3a5f;
}

/* Screw +/- buttons */
.collim-screw-btn {
    background: #1f2937;
    color: #9ca3af;
    border: 1px solid #374151;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.collim-screw-btn:hover {
    background: #374151;
    color: #e5e7eb;
}

.collim-screw-btn:active {
    background: #4b5563;
}

/* Screw diagram SVG */
.screw-diagram circle {
    fill: none;
    stroke: #4b5563;
    stroke-width: 1;
}

.screw-diagram .screw-dot {
    fill: #60a5fa;
    stroke: none;
}

.screw-diagram .screw-label {
    fill: #9ca3af;
    font-size: 12px;
    font-family: sans-serif;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Canvas container */
#collimation-canvas {
    background: #000000;
    border-radius: 6px;
}

/* Night mode overrides */
[data-theme="night"] .collim-type-btn {
    background: #2a0000;
    color: #884444;
    border-color: #440000;
}

[data-theme="night"] .collim-type-btn.active {
    background: #3a0000;
    color: #ff6666;
    border-color: #660000;
}

[data-theme="night"] .collim-toggle-group {
    background: #1a0000;
    border-color: #440000;
}

[data-theme="night"] .collim-toggle-btn.active {
    background: #3a0000;
    color: #ff6666;
}

[data-theme="night"] .collim-toggle-btn {
    color: #664444;
}

[data-theme="night"] .collim-screw-btn {
    background: #2a0000;
    color: #884444;
    border-color: #440000;
}

[data-theme="night"] .collim-screw-btn:hover {
    background: #3a0000;
    color: #cc6666;
}

[data-theme="night"] .collim-slider {
    background: #440000;
}

[data-theme="night"] .collim-slider::-webkit-slider-thumb {
    background: #cc3333;
    border-color: #660000;
}

[data-theme="night"] .collim-slider::-moz-range-thumb {
    background: #cc3333;
    border-color: #660000;
}

[data-theme="night"] .screw-diagram circle {
    stroke: #440000;
}

[data-theme="night"] .screw-diagram .screw-dot {
    fill: #cc4444;
}

[data-theme="night"] .screw-diagram .screw-label {
    fill: #884444;
}

[data-theme="night"] #quality-percent {
    color: #cc4444 !important;
}

[data-theme="night"] #success-msg {
    background: rgba(100, 0, 0, 0.3);
    border-color: #660000;
    color: #cc6666;
}

/* Loose screw warning pulse */
.screw-loose {
    color: #f97316 !important;
    animation: pulse-warn 0.8s ease-in-out infinite;
}

@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Night mode loose screw */
[data-theme="night"] .screw-loose {
    color: #cc6633 !important;
}

[data-theme="night"] #wobble-warning {
    background: rgba(100, 40, 0, 0.3);
    border-color: #663300;
    color: #cc8844;
}

/* Responsive */
@media (max-width: 768px) {
    .collim-slider {
        width: 100px;
    }

    #collimation-canvas {
        width: 100% !important;
        height: auto !important;
    }
}
