/* Base styling for the quiz renderer */
.api-quiz-builder-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: var(--background-color, #fff) !important; /* Use CSS variable with !important */
    font-family: "Inter", sans-serif !important; /* Explicitly set font with !important */
    color: var(--text-color, #333) !important; /* Use CSS variable with !important */
    transition: all 0.3s ease-in-out !important; /* Smooth transitions for design changes */
    box-sizing: border-box !important; /* Ensure padding doesn't increase total width */
}

.api-quiz-builder-container .loading-message {
    text-align: center !important;
    font-style: italic !important;
    color: var(--text-color, #666) !important;
}

.api-quiz-builder-quiz-title {
    text-align: center !important;
    font-size: 1.8em !important;
    margin-bottom: 10px !important;
    color: var(--text-color, #333) !important; /* Use CSS variable with !important */
    line-height: 1.2 !important;
}

.api-quiz-builder-quiz-description {
    text-align: center !important;
    font-size: 1em !important;
    color: var(--text-color, #666) !important; /* Use CSS variable with !important */
    margin-bottom: 20px !important;
}

.api-quiz-builder-progress-bar {
    width: 100% !important;
    background-color: var(--secondary-color, #e0e0e0) !important; /* Use secondary color for track */
    border-radius: 5px !important;
    height: 8px !important;
    margin-bottom: 20px !important;
}

.api-quiz-builder-progress-fill {
    height: 100% !important;
    width: 0% !important;
    background-color: var(--primary-color, #007bff) !important; /* Use primary color for fill */
    border-radius: 5px !important;
    transition: width 0.5s ease-in-out !important;
}

.api-quiz-builder-session-content {
    padding: 15px !important;
    text-align: center !important;
}

.api-quiz-builder-question-title {
    font-size: 1.5em !important;
    margin-bottom: 20px !important;
    color: var(--text-color, #333) !important; /* Use CSS variable with !important */
    line-height: 1.3 !important;
}

.api-quiz-builder-options-grid {
    display: grid !important;
    gap: 10px !important;
    max-width: 400px !important;
    margin: 0 auto !important;
}

/* Button Styles */
.api-quiz-builder-option-button,
.api-quiz-builder-button {
    background-color: var(--background-color, #f8f8f8) !important;
    border: 2px solid var(--secondary-color, #ccc) !important;
    color: var(--text-color, #333) !important;
    padding: 12px 15px !important;
    cursor: pointer !important;
    font-size: 1em !important;
    transition: all 0.2s ease-in-out !important;
    width: 100% !important;
    text-align: left !important;
    display: block !important; /* Ensure buttons take full width */
    box-sizing: border-box !important;
}

.api-quiz-builder-option-button:hover,
.api-quiz-builder-button:hover {
    background-color: var(--secondary-color, #e0e0e0) !important;
    color: var(--primary-color-foreground, #fff) !important; /* Assuming a foreground color for secondary */
    border-color: var(--primary-color, #007bff) !important;
}

.api-quiz-builder-option-button.selected {
    background-color: var(--primary-color, #007bff) !important;
    color: #fff !important; /* Always white for selected primary */
    border-color: var(--primary-color, #007bff) !important;
}

/* Specific Button Styles */
.api-quiz-builder-button-style-rounded {
    border-radius: 8px !important;
}
.api-quiz-builder-button-style-square {
    border-radius: 0 !important;
}
.api-quiz-builder-button-style-pill {
    border-radius: 9999px !important; /* Large value for pill shape */
}

/* Card Styles */
.api-quiz-builder-card-style-modern {
    background-color: var(--background-color, #fff) !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    padding: 20px !important;
}
.api-quiz-builder-card-style-minimal {
    background-color: var(--background-color, #fff) !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px !important;
}
.api-quiz-builder-card-style-gradient {
    background-image: linear-gradient(135deg, var(--background-color, #fff) 0%, var(--secondary-color, #f0f0f0) 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    padding: 20px !important;
}


.api-quiz-builder-form-fields {
    display: grid !important;
    gap: 15px !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    text-align: left !important;
}

.api-quiz-builder-form-fields label {
    display: block !important;
    margin-bottom: 5px !important;
    font-weight: bold !important;
    color: var(--text-color, #333) !important; /* Use CSS variable with !important */
}

.api-quiz-builder-form-fields input,
.api-quiz-builder-form-fields textarea {
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid var(--secondary-color, #ddd) !important; /* Use secondary color for borders */
    border-radius: 5px !important;
    font-size: 1em !important;
    box-sizing: border-box !important;
    color: var(--text-color, #333) !important;
    background-color: var(--background-color, #fff) !important;
}

.api-quiz-builder-form-fields input:focus,
.api-quiz-builder-form-fields textarea:focus {
    border-color: var(--primary-color, #007bff) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb, 0, 123, 255), 0.25) !important; /* Dynamic shadow */
}

.api-quiz-builder-navigation-buttons {
    margin-top: 20px !important;
    text-align: center !important;
}

.api-quiz-builder-button {
    background-color: var(--primary-color, #007bff) !important;
    color: #fff !important; /* Always white for primary buttons */
    border: none !important;
    padding: 12px 25px !important;
    cursor: pointer !important;
    font-size: 1.1em !important;
    transition: background-color 0.2s ease-in-out !important;
    margin: 0 5px !important;
    box-sizing: border-box !important;
}

.api-quiz-builder-button:hover {
    background-color: var(--primary-color-dark, #0056b3) !important; /* Darker shade for hover */
}

.api-quiz-builder-button:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
}

.api-quiz-builder-ad-container {
    min-height: 200px !important; /* Ensure ad container has some height */
    display: flex !important;
    flex-direction: column !important; /* Allow content to stack */
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--secondary-color, #f0f0f0) !important; /* Use secondary color */
    border: 1px dashed var(--primary-color, #ccc) !important; /* Use primary color for dashed border */
    padding: 20px !important;
    margin-bottom: 20px !important;
    color: var(--text-color, #666) !important;
    font-style: italic !important;
    text-align: center !important;
}

.api-quiz-builder-ad-container.test-mode {
    background-color: var(--primary-color-light, #e6f7ff) !important; /* Lighter primary for test mode */
    border-color: var(--primary-color, #91d5ff) !important;
    color: var(--primary-color-dark, #1890ff) !important;
}

.api-quiz-builder-ad-message {
    font-size: 1.2em !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    color: var(--text-color, #333) !important;
}

.api-quiz-builder-loading-screen {
    text-align: center !important;
    padding: 50px 20px !important;
}

.api-quiz-builder-loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1) !important;
    border-top: 4px solid var(--primary-color, #007bff) !important; /* Use primary color */
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    animation: spin 1s linear infinite !important;
    margin: 0 auto 20px !important;
}

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

.api-quiz-builder-result-screen {
    text-align: center !important;
    padding: 50px 20px !important;
}

.api-quiz-builder-result-icon {
    font-size: 3em !important;
    color: var(--primary-color, green) !important; /* Use primary color for success icon */
    margin-bottom: 20px !important;
}

.api-quiz-builder-result-title {
    font-size: 2em !important;
    margin-bottom: 10px !important;
    color: var(--text-color, #333) !important;
}

.api-quiz-builder-result-description {
    font-size: 1em !important;
    color: var(--text-color, #666) !important;
    margin-bottom: 20px !important;
}

.api-quiz-builder-redirect-countdown {
    font-size: 0.9em !important;
    color: var(--text-color, #666) !important;
    margin-top: 10px !important;
}

/* Footer styles */
.api-quiz-builder-footer {
    position: fixed !important; /* Rodapé fixo */
    bottom: 0 !important; /* Na parte inferior */
    left: 0 !important; /* Alinhado à esquerda */
    width: 100% !important; /* Largura total */
    z-index: 1000 !important; /* Garante que fique acima de outros elementos */
    
    background-color: var(--page-background-color, #f8f8f8) !important; /* Fundo neutro */
    color: var(--text-color, #777) !important; /* Cor do texto */
    margin-top: 0 !important; /* Remove margem superior */
    padding: 20px !important;
    border-top: 1px solid var(--secondary-color, #eee) !important; /* Borda superior */
    text-align: center !important;
    font-size: 0.85em !important;
    box-sizing: border-box !important;
}

.api-quiz-builder-footer a {
    color: var(--primary-color, #007bff) !important; /* Links usam a cor primária */
    text-decoration: underline !important;
}

.api-quiz-builder-footer a:hover {
    text-decoration: none !important;
}

.api-quiz-builder-footer-stats {
    margin-bottom: 15px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
}

.api-quiz-builder-footer-location,
.api-quiz-builder-footer-counter {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

.api-quiz-builder-footer-location span,
.api-quiz-builder-footer-counter span {
    margin: 0 3px !important;
}

.api-quiz-builder-footer-location .icon,
.api-quiz-builder-footer-counter .icon {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 5px !important;
}

.api-quiz-builder-footer-counter .text-green-600 {
    color: var(--primary-color, #28a745) !important; /* Contador usa a cor primária */
    font-weight: bold !important;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.api-quiz-builder-animation-fade .api-quiz-builder-session-content > div {
    animation: fade-in 0.5s ease-out forwards !important;
}
.api-quiz-builder-animation-slide .api-quiz-builder-session-content > div {
    animation: slide-up 0.5s ease-out forwards !important;
}
.api-quiz-builder-animation-scale .api-quiz-builder-session-content > div {
    animation: scale-in 0.5s ease-out forwards !important;
}