/* Resistor Color Code Calculator Custom Styles */

html {
    scroll-behavior: smooth;
}

/* Main Container */
.calculator-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .calculator-container {
        padding: 1.5rem 1rem;
    }
}

/* Header decoration */
.calc-header {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.calc-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Resistor Visualizer Box */
.resistor-visualizer-box {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.resistor-svg-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.resistor-svg {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

/* Controls & Selectors */
.band-btn-group {
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 30px;
    display: inline-flex;
    border: 1px solid #e2e8f0;
}

.band-btn {
    border: none;
    background: transparent;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 20px;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.band-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Body type toggles */
.body-type-select {
    font-size: 0.85rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.body-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Color grid for selectors */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
    margin-top: 0.8rem;
}

@media (max-width: 1200px) {
    .color-picker-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .color-picker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
}

/* Color Option Buttons */
.color-btn {
    position: relative;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.5rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 70px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.color-btn:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.color-btn.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15), 0 4px 10px rgba(13, 110, 253, 0.1);
    background-color: #f8fafc;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-bottom: 0.35rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.1);
    position: relative;
}

.color-swatch.color-gold {
    background: linear-gradient(135deg, #ffe066 0%, #d4af37 50%, #aa8500 100%);
}

.color-swatch.color-silver {
    background: linear-gradient(135deg, #ffffff 0%, #c0c0c0 50%, #7f7f7f 100%);
}

.color-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-transform: capitalize;
    text-align: center;
    line-height: 1.1;
}

/* Disable state for buttons */
.color-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Results Display Box (Glassmorphic) */
.result-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--primary-color);
    border-radius: 14px;
    padding: 1.8rem;
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.result-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--dark-bg);
    line-height: 1;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.result-unit {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

.result-range-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.8rem;
}

.result-range-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
}

.result-spec-badge {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid #e2e8f0;
}

.result-spec-badge i {
    font-size: 0.9rem;
    margin-right: 0.35rem;
}

.result-spec-badge.tolerance {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.result-spec-badge.tempco {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Reverse Calculator Panel */
.reverse-calc-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.reverse-calc-input-group {
    max-width: 480px;
    margin: 0 auto;
}

/* Standard values helper list */
.quick-values-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
    justify-content: center;
}

.quick-val-badge {
    font-size: 0.75rem;
    font-weight: 500;
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-val-badge:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Reference Table styles */
.table-reference-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-reference {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table-reference th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 2px solid #e2e8f0;
}

.color-td {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-indicator-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-block;
}

/* Specific theme helper colors */
.color-dot-black { background-color: #000000; }
.color-dot-brown { background-color: #8B4513; }
.color-dot-red { background-color: #FF3333; }
.color-dot-orange { background-color: #FF8C00; }
.color-dot-yellow { background-color: #FFEB3B; }
.color-dot-green { background-color: #4CAF50; }
.color-dot-blue { background-color: #2196F3; }
.color-dot-violet { background-color: #9C27B0; }
.color-dot-grey { background-color: #9E9E9E; }
.color-dot-white { background-color: #FFFFFF; }
.color-dot-gold { background: linear-gradient(135deg, #ffe066, #d4af37, #aa8500); }
.color-dot-silver { background: linear-gradient(135deg, #ffffff, #c0c0c0, #7f7f7f); }

/* Animation trigger on update */
@keyframes highlight-glow {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

.pulse-update {
    animation: highlight-glow 0.6s ease-out;
}

/* Fade in for the section */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

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