/* Ohm's Law Calculator - Custom Styles */

/* Calculator Input Styles */
.calc-input {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    min-width: 0;
    transition: all 0.2s ease;
}

.calc-input:hover:not(:disabled) {
    border-color: #fa8c1e;
    box-shadow: 0 0 0 1px rgba(250, 140, 30, 0.1);
}

.calc-input:focus {
    outline: none;
    border-color: #fa8c1e;
    box-shadow: 0 0 0 3px rgba(250, 140, 30, 0.1);
    ring-offset: 2px;
}

.calc-input:disabled {
    background-color: #fff8f0;
    cursor: not-allowed;
    opacity: 0.9;
}

/* Calculator Card Styles */
.calc-card {
    transition: all 0.3s ease;
}

.calc-card.locked {
    background-color: #fff;
    border-color: #d1d5db;
}

.calc-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.calc-card.calculated {
    background-color: #fff8f0;
    border-color: #ffc996;
}

.calc-card.calculated .calc-input {
    color: #fa8c1e;
}

.calc-card.calculated .calc-input:disabled {
    color: #fa8c1e;
}

/* Formula Card Styles */
.formula-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    cursor: default;
}

.formula-card:hover {
    opacity: 0.8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.formula-card.active {
    opacity: 1;
    background-color: #fff8f0;
    border-color: #fa8c1e;
    transform: scale(1.03);
    box-shadow: 0 4px 6px -1px rgba(250, 140, 30, 0.2), 0 2px 4px -1px rgba(250, 140, 30, 0.1);
}

/* Unit Select Styles */
.unit-select {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.unit-select:hover:not(:disabled) {
    border-color: #fa8c1e;
}

.unit-select:focus {
    outline: none;
    border-color: #fa8c1e;
    box-shadow: 0 0 0 3px rgba(250, 140, 30, 0.1);
}

.unit-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Button Hover and Focus Improvements */
button:focus-visible {
    outline: 2px solid #fa8c1e;
    outline-offset: 2px;
}

button:not(:disabled):active {
    transform: scale(0.98);
}

/* Circuit Diagram Styles */
.circuit-value {
    fill: #fa8c1e;
    font-weight: 600;
}

/* Resistor Color Band Styles */
.resistor-body {
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, #e8d4b8 0%, #d4ba9a 50%, #c4a77f 100%);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.resistor-body:hover {
    transform: scale(1.02);
}

.resistor-lead {
    position: absolute;
    height: 2px;
    width: 15px;
    background: #9ca3af;
    top: 50%;
    transform: translateY(-50%);
}

.resistor-lead.left {
    left: -15px;
}

.resistor-lead.right {
    right: -15px;
}

.color-band {
    width: 8px;
    height: 100%;
    border-radius: 1px;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
}

.color-band.wide {
    width: 12px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced Card Shadows and Spacing */
.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Consistent Spacing for Sections */
.section-spacing {
    margin-bottom: 2rem;
}

/* Improved History Card Hover */
.history-item:hover {
    background-color: #fffbf5;
    border-color: #ffc996;
    cursor: pointer;
    transform: translateX(4px);
    transition: all 0.2s ease;
}

/* Responsive Text Sizing - Mobile */
@media (max-width: 640px) {
    .calc-input {
        font-size: 1.125rem;
    }

    h1 {
        font-size: 1.875rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    /* Stack buttons vertically on mobile */
    .flex.gap-3 {
        flex-direction: column;
    }

    .flex.gap-3 button {
        width: 100%;
    }

    /* Reduce padding on cards for mobile */
    .bg-white.rounded-lg.shadow-md .p-4 {
        padding: 0.75rem;
    }

    /* Make example cards easier to tap on mobile */
    .example-card {
        padding: 1rem !important;
    }
}

/* Responsive Text Sizing - Tablet */
@media (min-width: 640px) and (max-width: 1024px) {
    .calc-input {
        font-size: 1.125rem;
    }

    /* Adjust grid layouts for tablet */
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
    .calc-card:hover {
        transform: translateY(-2px);
    }

    /* Smooth transitions for larger screens */
    .transition-all {
        transition-duration: 200ms;
    }
}

/* Focus Ring Color for Better Accessibility */
*:focus-visible {
    outline-color: #fa8c1e;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .shadow-md {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
