/**
 * WP Demo Sandbox - Frontend Styles
 */

/* Form Container */
.wp-demo-sandbox-form {
    width: 100%;
}

/* Form Fields */
.wp-demo-sandbox-form .form-group {
    margin-bottom: 1rem;
}

.wp-demo-sandbox-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3338;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Submit Button */
.wp-demo-sandbox-form button[type="submit"] {
    background: #2271b1;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: 1px solid #2271b1;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: visible;
}

.wp-demo-sandbox-form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wp-demo-sandbox-form button[type="submit"]:hover {
    background: #135e96;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.wp-demo-sandbox-form button[type="submit"]:active {
    background: #135e96;
    transform: translateY(1px);
    box-shadow: none;
}

.wp-demo-sandbox-button-icon {
    font-size: 1.2rem;
    line-height: 1.5rem;
    vertical-align: middle;
}

.wp-demo-sandbox-challenge-text {
    margin: 0.5rem 0 0;
}

.wp-demo-sandbox-custom-text {
    margin: 1rem 0;
    padding: 0.75rem 0;
    color: #2c3338;
    font-size: 0.95rem;
    line-height: 1.6;
}

.wp-demo-sandbox-duplication-result {
    margin-top: 1rem;
}

/* Specific styling for the math answer input */
.wp-demo-sandbox-answer-input {
    padding: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 2px solid #2271b1;
    border-radius: 4px;
    background-color: #f9fafb;
    width: 100%;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.wp-demo-sandbox-answer-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Hide default spinners in number input on WebKit for a cleaner look */
.wp-demo-sandbox-answer-input::-webkit-outer-spin-button,
.wp-demo-sandbox-answer-input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

/* Spinner icon for demo site creation (used inside the submit button) */
.wp-demo-sandbox-spinner {
    display: inline-block;
    animation: wp-demo-sandbox-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.wp-demo-sandbox-button-text {
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes wp-demo-sandbox-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Admin bar demo countdown badge (frontend) */
#wpadminbar .wp-demo-sandbox-admin-bar-notice {
    background-color: #d63638 !important;
    color: #ffffff !important;
    border-radius: 10px;
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    box-sizing: border-box;
    margin-top: 4px;
}

#wpadminbar .wp-demo-sandbox-admin-bar-notice * {
    color: #ffffff !important;
    text-decoration: none;
}

#wpadminbar .wp-demo-sandbox-admin-bar-notice:hover .ab-item {
    background-color: transparent !important;
}

#wpadminbar #wp-demo-sandbox-countdown-minutes {
    font-weight: 700;
}

/* Status Messages */
.wp-demo-sandbox-status {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.wp-demo-sandbox-status.success {
    background: #ecf7ed;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wp-demo-sandbox-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading State */
.wp-demo-sandbox-form button[type="submit"].loading {
    position: relative;
    color: transparent;
}

.wp-demo-sandbox-form button[type="submit"].loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Notice */
.notice {
    margin: 20px 0;
}
.notice-error {
    color: red;
    font-weight: 700;
}
.notice-info {
    color: green;
    font-weight: 700;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .wp-demo-sandbox-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .wp-demo-sandbox-form h2 {
        font-size: 1.25rem;
    }
} 