/* --- Basic Styles for the Quiz Container --- */
#gemini-quiz-container {
    margin: 30px 0;
}
.gqg-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}
.gqg-header {
    background-color: #d32f2f;
    color: #fff;
    padding: 25px 30px;
    text-align: center;
}
.gqg-header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2em;
    font-weight: 700;
    margin: 0 0 10px;
}
.gqg-header-icon {
    font-size: 32px;
    line-height: 1;
}
.gqg-header-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    margin: 0;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    overflow-wrap: break-word; /* Ensures long text wraps */
    word-wrap: break-word;     /* Fallback for older browsers */
}
.gqg-body {
    background: #fff;
    padding: 40px 30px;
    text-align: center;
}
.gqg-body p {
    font-size: 1.2em;
    color: #555;
    margin: 0 0 25px;
}

/* --- General Card Styles (for questions) --- */
.gqg-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.gqg-card h2, .gqg-card h3 {
    margin-top: 0;
    color: #111;
}
.gqg-card p {
    overflow-wrap: break-word; /* Prevents long text from overflowing */
    word-wrap: break-word;     /* Fallback for older browsers */
}


/* --- Button Styles --- */
.gqg-button {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: normal; /* Allow text to wrap inside the button */
    overflow-wrap: break-word; /* Wrap long words */
    word-wrap: break-word; /* Fallback */
    word-break: break-all; /* More aggressive wrapping for difficult strings */
    line-height: 1.4; /* Improve readability for multi-line text */
}
.gqg-button:hover {
    background-color: #f5f5f5;
    border-color: #aaa;
}
.gqg-button-primary {
    display: inline-block;
    width: auto;
    background: linear-gradient(to bottom, #e53935, #c62828);
    color: #fff;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}
.gqg-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}
.gqg-button-primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.3);
}

/* --- Answer & Feedback Styles --- */
.gqg-answers {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gqg-answer {
    position: relative;
}
.gqg-answers--disabled .gqg-button {
    pointer-events: none;
    opacity: 0.8;
}
.gqg-answer.is-correct .gqg-button {
    background-color: #d1f7e0;
    border-color: #40c057;
    font-weight: bold;
    color: #1a5c30;
}
.gqg-answer.is-wrong .gqg-button {
    background-color: #ffe3e3;
    border-color: #ff6b6b;
    font-weight: bold;
    color: #a61e1e;
}
.gqg-badge {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}
.gqg-badge--success { background-color: #28a745; }
.gqg-badge--danger { background-color: #dc3545; }
.gqg-notice {
    display: none;
    margin-top: 15px;
    padding: 12px;
    border-left: 4px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    color: #343a40;
    background-color: #f1f3f5;
    text-align: left;
}
.gqg-notice--success { border-color: #28a745; background-color: #eaf6ec; }
.gqg-notice--error { border-color: #dc3545; background-color: #fbebee; }

/* --- Loader --- */
.quiz-loader-container {
    text-align: center;
    padding: 40px 0;
    color: #555;
}
.quiz-loader {
    display: inline-block;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Related Links Styles --- */
.gqg-related-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}
.gqg-related-links h4 {
    font-size: 1.2em;
    color: #333;
    margin: 0 0 15px;
}
.gqg-related-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
.gqg-related-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    color: #343a40;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}
.gqg-related-links li a::before {
    content: '👉';
    font-size: 1.2em;
    color: #d32f2f;
}
.gqg-related-links li a:hover {
    background-color: #fff;
    border-color: #d32f2f;
    color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

