/* Frontend styles are already included in the registration-form.php file */
/* This file can be used for additional custom styles if needed */

/* Loading Animation */
.sbr-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Transitions for Form Elements */
.sbr-smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Section Animations */
.form-section {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Field Focus Effects */
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transition: all 0.3s ease;
}

/* Button Hover Effects */
.sbr-submit-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sbr-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.sbr-submit-btn:active {
    transform: translateY(0);
}

/* Button Ripple Effect */
.sbr-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.sbr-submit-btn:active::before {
    width: 300px;
    height: 300px;
}

.sbr-submit-btn span {
    position: relative;
    z-index: 1;
}

/* Cost Summary Animation */
.cost-summary {
    transition: all 0.4s ease;
}

.cost-line {
    transition: all 0.3s ease;
}

.cost-line:hover {
    background: rgba(0, 123, 255, 0.05);
    padding: 8px;
    border-radius: 4px;
}

/* Payment Amount Highlight Animation */
.payment-amount {
    animation: pulseHighlight 0.8s ease-in-out;
}

@keyframes pulseHighlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(0, 123, 255, 0.3); }
}

/* Form Validation Animation */
.field-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.sbr-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.sbr-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.sbr-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.payment-processing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

.session-highlight {
    background: #e7f3ff;
    padding: 10px;
    border-left: 4px solid #007bff;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out;
}

.session-highlight:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Payment Section Animations */
.payment-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.payment-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Radio Group Enhancements */
.radio-group label {
    transition: all 0.3s ease;
    cursor: pointer;
}

.radio-group label:hover {
    background: rgba(0, 123, 255, 0.05);
    transform: translateX(3px);
}

.radio-group input[type="radio"]:checked + * {
    color: #007bff;
    font-weight: 600;
}

/* Form Messages Animation */
#form-messages {
    transition: all 0.4s ease;
    transform: scale(0.95);
}

#form-messages.show {
    transform: scale(1);
    animation: messageSlideIn 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Success Message Glow */
.success-message {
    animation: successGlow 1s ease-in-out;
    position: relative;
    overflow: hidden;
}

.success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: successSweep 2s ease-in-out;
}

@keyframes successGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(40, 167, 69, 0.3); }
    50% { box-shadow: 0 0 20px rgba(40, 167, 69, 0.6); }
}

@keyframes successSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Loading States */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.processing-overlay.active {
    opacity: 1;
    visibility: visible;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.processing-text {
    color: white;
    font-size: 18px;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Hover Effects for Form Sections */
.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Grade Level Selection Animation */
#grade_level {
    position: relative;
}

#grade_level:focus {
    animation: selectFocus 0.3s ease-out;
}

@keyframes selectFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Cost Update Animation */
.cost-update {
    animation: costUpdate 0.6s ease-out;
}

@keyframes costUpdate {
    0% {
        background: rgba(0, 123, 255, 0.1);
        transform: scale(1);
    }
    50% {
        background: rgba(0, 123, 255, 0.2);
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Responsive improvements */
@media (max-width: 480px) {
    .cost-line {
        flex-direction: column;
        text-align: left;
    }

    .cost-line span:first-child {
        font-weight: bold;
        margin-bottom: 2px;
    }

    .radio-group label {
        padding: 10px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        margin-bottom: 5px;
        background: #f8f9fa;
    }

    .radio-group input[type="radio"]:checked + span {
        font-weight: bold;
    }
}