.smc-calculator {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    position: relative; /* Ensure background positioning works */
}

.smc-title.smc-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color) !important;
    text-align: center;
    margin-bottom: 10px;
    z-index: 1; /* Ensure title stays above background */
}

.smc-custom-text.smc-text {
    font-size: 16px;
    color: var(--text-color) !important;
    text-align: center;
    margin-bottom: 20px;
    z-index: 1; /* Ensure text stays above background */
}

.smc-field {
    margin-bottom: 15px;
}

.smc-field label.smc-text {
    display: block;
    font-size: 14px;
    color: var(--text-color) !important;
    margin-bottom: 5px;
}

.smc-field input.smc-text,
.smc-field select.smc-text {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: var(--form-text-color, var(--text-color)) !important; /* Use form text color with text color fallback */
}

.smc-checkbox.smc-text input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.smc-checkbox.smc-text {
    color: var(--text-color) !important;
}

.smc-button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.smc-button.smc-text {
    width: 100%;
    max-width: 200px;
    padding: 10px;
    background: var(--primary);
    color: var(--text-color, white) !important; /* Use text color with white fallback for image button */
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.smc-button.smc-text:hover {
    background: var(--secondary);
}

.smc-image-button {
    padding: 0;
    background: none !important;
    border: none !important;
    cursor: pointer;
    overflow: hidden; /* Clip overflow to respect border-radius */
}

.smc-image-button img {
    width: 100%;
    height: 100%; /* Ensure height matches width */
    object-fit: cover; /* Maintain image aspect ratio */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.smc-image-button img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 48, 135, 0.3); /* Dark blue glow */
}

.smc-image-button img:active {
    transform: scale(0.95);
}

.smc-error.smc-text {
    background: #ffe6e6;
    color: var(--text-color) !important;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.smc-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.smc-popup-content {
    background: var(--background);
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.smc-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    text-align: center;
    line-height: 24px;
}

.smc-popup-close svg {
    width: 100%;
    height: 100%;
    display: block;
}

.smc-popup-close-fallback.smc-text {
    display: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 24px;
    color: var(--text-color) !important;
}

.smc-popup-close:hover svg path {
    stroke: var(--secondary);
}

.smc-popup-close:hover .smc-popup-close-fallback.smc-text {
    color: var(--secondary);
}

.smc-result-title.smc-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--popup-text-color, var(--text-color)) !important;
    text-align: center;
    margin-bottom: 10px;
}

.smc-distance.smc-text {
    font-size: 14px;
    color: var(--popup-text-color, var(--text-color)) !important;
    text-align: center;
    margin-bottom: 10px;
}

.smc-contact-text.smc-text {
    font-size: 14px;
    color: var(--popup-text-color, var(--text-color)) !important;
    text-align: center;
    margin-bottom: 10px;
}

.smc-contact-text.smc-text a {
    color: #0000FF !important; /* Ensure telephone link is blue, overriding popup_text_color */
    text-decoration: none;
    font-weight: bold;
}

.smc-contact-text.smc-text a:hover {
    color: var(--secondary) !important; /* Maintain secondary color on hover */
    text-decoration: underline;
}

.smc-call-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #ffffff;
    border: 2px solid #ff4444; /* Red border for flashy effect */
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    color: #ff4444; /* Red text for contrast */
    animation: pulse 1.5s infinite;
    transition: all 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px 5px rgba(255, 68, 68, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

.smc-call-button:hover {
    background: #ff4444;
    color: #ffffff;
    border-color: #ff6666;
    transform: scale(1.1);
    animation: none; /* Pause pulse on hover */
}

.smc-text #smc-cost.smc-text {
    color: var(--popup-text-color, var(--text-color)) !important;
}

.smc-text #smc-distance.smc-text {
    color: var(--popup-text-color, var(--text-color)) !important;
}

.pac-container {
    font-family: Arial, sans-serif;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.pac-item {
    padding: 8px;
    font-size: 14px;
    color: var(--text-color) !important;
}

.pac-item:hover {
    background: var(--secondary);
    color: white;
}

/* Admin styles */
.smc-flooring-entry, .smc-obstacle-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.smc-flooring-entry input, .smc-obstacle-entry input, .smc-obstacle-entry select {
    width: 200px;
}