/* Scoped styles with GeneratePress compatibility */
.gp-impulse-calculator {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 30px;
    background: linear-gradient(135deg, #fef2f2, #fff7ed); /* Soft red to orange */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: inherit; /* Inherit GeneratePress typography */
    position: relative;
    overflow: hidden;
}

/* Subtle background overlay */
.gp-impulse-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0.4;
    z-index: 0;
}

.gp-impulse-calculator > * {
    position: relative;
    z-index: 1;
}

.gp-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(45deg, #ef4444, #f59e0b); /* Red to orange, as original */
    border-radius: 10px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.gp-header:hover {
    transform: translateY(-5px);
}

.gp-impulse-calculator h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gp-formula {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.2rem;
    color: #1e293b;
    font-style: italic;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
}

.gp-formula-icon {
    margin-right: 10px;
    font-size: 1.4rem;
}

.gp-form-group {
    margin-bottom: 20px;
}

.gp-input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gp-input-box label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.gp-icon {
    margin-right: 8px;
    color: #ef4444; /* Red for consistency */
    font-size: 1.3rem;
}

.gp-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gp-input-row input,
.gp-input-row select {
    width: 100%;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.gp-input-row input:focus,
.gp-input-row select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    transform: scale(1.02);
}

.gp-input-row input:hover,
.gp-input-row select:hover {
    border-color: #f59e0b; /* Orange on hover */
}

.gp-input-row select.unit {
    flex: 0 0 100px;
    background: #fee2e2; /* Light red */
    color: #1e293b;
}

.gp-control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.gp-calculate-btn,
.gp-reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.gp-calculate-btn {
    background: linear-gradient(45deg, #ef4444, #f59e0b); /* Red to orange */
    color: #ffffff;
}

.gp-calculate-btn:hover {
    background: linear-gradient(45deg, #dc2626, #d97706);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.gp-reset-btn {
    background: linear-gradient(45deg, #6b7280, #d1d5db); /* Gray tones */
    color: #ffffff;
}

.gp-reset-btn:hover {
    background: linear-gradient(45deg, #4b5563, #9ca3af);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(107, 114, 128, 0.4);
}

.gp-result-wrapper {
    perspective: 1000px;
}

.gp-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    background: #ffffff;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: rotateY(10deg);
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.gp-result.show {
    display: block;
    transform: rotateY(0);
    opacity: 1;
}

.gp-result h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.gp-result p {
    margin-bottom: 10px;
    font-size: 18px;
    color: #4b5563;
    font-weight: 500;
}

.gp-impulse-info {
    margin-top: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #fef2f2, #fff7ed); /* Red to orange */
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    font-size: 14px;
    color: #374151;
}

/* Error styling */
.gp-error {
    margin-top: 1rem;
    padding: 15px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    display: none;
    text-align: center;
    font-weight: 500;
}

.gp-error.show {
    display: block;
}

/* Responsive design */
@media (max-width: 768px) {
    .gp-impulse-calculator {
        padding: 20px;
        margin: 0 15px 30px;
    }

    .gp-impulse-calculator h1 {
        font-size: 24px;
    }

    .gp-input-group {
        grid-template-columns: 1fr;
    }

    .gp-control-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .gp-input-row select.unit {
        flex: 0 0 80px;
    }
}

/* Slide-in animation for inputs */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gp-input-box {
    animation: slideIn 0.5s ease forwards;
    animation-delay: calc(var(--order) * 0.1s);
}

.gp-input-box:nth-child(1) { --order: 1; }
.gp-input-box:nth-child(2) { --order: 2; }
.gp-input-box:nth-child(3) { --order: 3; }
.gp-input-box:nth-child(4) { --order: 4; }