/* Custom CSS styles for the Resistor Calculator */

/* Custom radio button styles for band toggles */
input[type="radio"]:checked+label {
    background-color: transparent;
}

#label-4band,
#label-5band {
    transition: all 0.2s ease;
}

#label-4band.active,
#label-5band.active {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #2563EB;
}

.dark #label-4band.active,
.dark #label-5band.active {
    background-color: #374151;
    /* gray-700 */
    color: #60A5FA;
}

/* Tab buttons styling */
.tab-btn.active {
    background-color: white;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .tab-btn.active {
    background-color: #374151;
    color: white;
}

/* Custom Scrollbar for color selects */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

select:focus {
    outline: none;
}

/* Visual Resistor Drawing */
.resistor-body {
    width: 320px;
    height: 64px;
    position: relative;
    background: transparent;
}

.wire {
    width: 40px;
    height: 4px;
    background-color: #94a3b8;
    /* gray-400 */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.wire.left {
    left: -40px;
}

.wire.right {
    right: -40px;
}

.dark .wire {
    background-color: #64748b;
}

.cap {
    width: 40px;
    height: 64px;
    background-color: #E6D5B8;
    /* Classic beige resistor color */
    border: 2px solid #D4B895;
    z-index: 10;
}

.cap.left {
    border-radius: 12px 0 0 12px;
    border-right: none;
}

.cap.right {
    border-radius: 0 12px 12px 0;
    border-left: none;
}

.center-body {
    height: 52px;
    background-color: #E6D5B8;
    border-top: 2px solid #D4B895;
    border-bottom: 2px solid #D4B895;
    z-index: 5;
    margin: 0 -2px;
    /* Overlap borders */
}

/* Optional: Different body color for 1% / 2% metal film (usually blue) */
.resistor-body.metal-film .cap,
.resistor-body.metal-film .center-body {
    background-color: #93C5FD;
    /* blue-300 */
    border-color: #60A5FA;
    /* blue-400 */
}

.color-band {
    width: 12px;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.tolerance-band {
    width: 12px;
    height: 60px;
    /* Slightly taller to fit the cap */
}

/* Custom Band Select Wrappers */
.color-select-wrapper {
    position: relative;
}

.color-indicator {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.dark .color-indicator {
    border-color: rgba(255, 255, 255, 0.1);
}

.color-select {
    padding-left: 40px !important;
}

/* Color Classes applied dynamically */
.bg-band-black {
    background-color: #262626 !important;
}

.bg-band-brown {
    background-color: #8B4513 !important;
}

.bg-band-red {
    background-color: #EF4444 !important;
}

.bg-band-orange {
    background-color: #F97316 !important;
}

.bg-band-yellow {
    background-color: #EAB308 !important;
}

.bg-band-green {
    background-color: #22C55E !important;
}

.bg-band-blue {
    background-color: #3B82F6 !important;
}

.bg-band-violet {
    background-color: #8B5CF6 !important;
}

.bg-band-gray {
    background-color: #6B7280 !important;
}

.bg-band-white {
    background-color: #F9FAFB !important;
    border: 1px solid #E5E7EB;
}

.bg-band-gold {
    background-color: #D4AF37 !important;
}

.bg-band-silver {
    background-color: #C0C0C0 !important;
}

.bg-band-none {
    background-color: transparent !important;
}

.dark .bg-band-white {
    border: 1px solid #374151;
}