/* Wire Mesh Calculator CSS
 * Extracted from calculator_standalone.html
 * Scoped to .wiremesh-calculator-wrapper for distinct isolation
 */

/* Scoped variables if needed, though :root typically is global. 
   We'll use specific values or rely on Tailwind config. */
.wiremesh-calculator-wrapper {
    --primary-color: #2563eb;
    /* Blue-600 */
    /* Font family inherited from theme as requested, or explicitly set if needed */
}

.wiremesh-calculator-wrapper .glass-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Custom Button Style */
.wiremesh-calculator-wrapper .cta-button {
    transition: all 0.3s ease;
    transform: perspective(1px) translateZ(0);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.4);
}

.wiremesh-calculator-wrapper .cta-button:hover {
    box-shadow: 0 6px 10px rgba(37, 99, 235, 0.6);
    transform: scale(1.02);
}

/* Select Dropdown Styling */
.wiremesh-calculator-wrapper .select-wrapper {
    position: relative;
}

.wiremesh-calculator-wrapper .select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.8rem;
    height: 0.8rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    transition: transform 0.2s;
}

/* Fix for double arrows: Remove default browser appearance */
.wiremesh-calculator-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    cursor: pointer;
}

/* Fix cursor for select options */
.wiremesh-calculator-wrapper select option {
    cursor: pointer;
}

.wiremesh-calculator-wrapper .result-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: hidden;
}

.wiremesh-calculator-wrapper .result-card.active {
    opacity: 1;
    transform: translateY(0);
    max-height: 2000px;
}

/* Mode Switch Styling */
.wiremesh-calculator-wrapper .mode-switch input[type="radio"] {
    display: none;
}

.wiremesh-calculator-wrapper .mode-switch label {
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
    color: #4b5563;
    /* gray-600 */
}

/* Note: Checked state logic requires referencing the input state */
.wiremesh-calculator-wrapper .mode-switch input[type="radio"]:checked+label {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Input transition for visibility */
.wiremesh-calculator-wrapper .input-group {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease-out;
    padding: 0;
}

.wiremesh-calculator-wrapper .input-group.active {
    opacity: 1;
    max-height: 500px;
    padding: 1.5rem 0 0;
}

/* Loading state for buttons */
.wiremesh-calculator-wrapper .button-loading {
    position: relative;
    color: transparent !important;
}

.wiremesh-calculator-wrapper .button-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Error state for inputs */
.wiremesh-calculator-wrapper .input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}