/* Spinner Styles for Digicalculator Plugin */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    visibility: hidden;
    opacity: 0;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin: 4px 10px 0;
    transition: opacity 0.3s ease;
}

.spinner.is-active,
.spinner.show {
    visibility: visible;
    opacity: 1;
}

/* Alternative WordPress-style spinner (if you have spinner.gif) */
.spinner.wp-style {
    background: url('../images/spinner.gif') no-repeat center;
    background-size: 20px 20px;
    border: none;
    animation: none;
}

/* Keyframes for CSS spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading overlay styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-overlay .spinner {
    visibility: visible;
    opacity: 1;
}

/* Full-screen spinner overlay */
.spinner-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
}

.spinner-fullscreen.active {
    display: flex;
}

.spinner-fullscreen .spinner {
    visibility: visible;
    opacity: 1;
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin: 0;
}

/* Alternative full-screen with darker background */
.spinner-fullscreen.dark {
    background: rgba(0, 0, 0, 0.7);
}

.spinner-fullscreen.dark .spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

/* Full-screen with loading text */
.spinner-fullscreen .loading-text {
    position: absolute;
    top: 60%;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.spinner-fullscreen.dark .loading-text {
    color: #ffffff;
}

/* Utility classes for full-screen spinner */
.spinner-fullscreen.no-blur {
    backdrop-filter: none;
}

.spinner-fullscreen.transparent {
    background: rgba(255, 255, 255, 0.3);
}

.spinner-fullscreen.opaque {
    background: rgba(255, 255, 255, 1);
}

/* Animated entrance/exit */
.spinner-fullscreen {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.spinner-fullscreen.active {
    opacity: 1;
}

/* Large spinner variant for full-screen */
.spinner-fullscreen .spinner.large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Prevent body scroll when full-screen spinner is active */
body.spinner-active {
    overflow: hidden;
}

/* Alternative spinner designs */
.spinner.pulse {
    border: none;
    background: #3498db;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.7; 
    }
}

.spinner.dots {
    width: 60px;
    height: 20px;
    background: none;
    border: none;
    position: relative;
}

.spinner.dots:before,
.spinner.dots:after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3498db;
    animation: dots 1.4s infinite ease-in-out both;
}

.spinner.dots:before {
    left: -20px;
    animation-delay: -0.32s;
}

.spinner.dots:after {
    left: 20px;
    animation-delay: -0.16s;
}

@keyframes dots {
    0%, 80%, 100% { 
        transform: scale(0);
    } 
    40% { 
        transform: scale(1.0);
    }
}
