/**
 * Healthcare Security Quiz - Frontend Styles
 */

/* Container */
.hsq-quiz-container {
    max-width: 800px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Buttons */
.hsq-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hsq-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.hsq-btn-primary {
    background: #2271b1;
    color: white;
}

.hsq-btn-primary:hover {
    background: #135e96;
    color: white;
}

.hsq-btn-success {
    background: #00a32a;
    color: white;
}

.hsq-btn-success:hover {
    background: #008a20;
    color: white;
}

.hsq-btn-danger {
    background: #d63638;
    color: white;
}

.hsq-btn-danger:hover {
    background: #b32d2e;
    color: white;
}

.hsq-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Intro Screen */
.hsq-quiz-intro {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hsq-quiz-intro h2 {
    margin-top: 0;
    color: #1e1e1e;
}

.hsq-quiz-intro p {
    font-size: 16px;
    line-height: 1.6;
    color: #3c434a;
}

/* Loading Spinner */
.hsq-loading {
    text-align: center;
    padding: 20px;
}

.hsq-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: hsq-spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Progress Bar */
.hsq-progress {
    background: #f0f0f1;
    border-radius: 4px;
    height: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hsq-progress-bar {
    background: linear-gradient(90deg, #2271b1, #135e96);
    height: 100%;
    transition: width 0.4s ease;
}

.hsq-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #1e1e1e;
    font-size: 14px;
}

/* Quiz Content */
.hsq-quiz-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Email Scenario */
.hsq-email {
    background: #f9f9f9;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.hsq-email-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.hsq-email-from,
.hsq-email-subject {
    margin-bottom: 10px;
    font-size: 14px;
    color: #3c434a;
}

.hsq-email-from strong,
.hsq-email-subject strong {
    color: #1e1e1e;
    font-weight: 600;
}

.hsq-email-body {
    font-size: 15px;
    line-height: 1.8;
    color: #2c3338;
    white-space: pre-wrap;
}

/* Actions */
.hsq-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.hsq-actions .hsq-btn {
    flex: 1;
    max-width: 250px;
}

/* Feedback */
.hsq-feedback {
    margin-top: 30px;
}

.hsq-feedback-correct {
    background: #d7f1e3;
    border-left: 4px solid #00a32a;
    padding: 20px;
    border-radius: 4px;
}

.hsq-feedback-incorrect {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 20px;
    border-radius: 4px;
}

.hsq-feedback h3 {
    margin-top: 0;
    font-size: 20px;
}

.hsq-feedback-correct h3 {
    color: #00a32a;
}

.hsq-feedback-incorrect h3 {
    color: #d63638;
}

.hsq-feedback p {
    line-height: 1.6;
    margin: 15px 0;
}

.hsq-attack-info {
    background: white;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
}

.hsq-feedback .hsq-btn {
    margin-top: 15px;
}

/* Results */
.hsq-quiz-results {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hsq-quiz-results h2 {
    margin-top: 0;
    color: #1e1e1e;
}

.hsq-results-summary {
    margin: 40px 0;
}

.hsq-score {
    font-size: 64px;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 10px;
}

.hsq-score-total {
    font-size: 32px;
    color: #3c434a;
}

.hsq-score-text {
    font-size: 18px;
    color: #3c434a;
    margin-top: 20px;
}

/* Scenario List */
.hsq-results-details {
    text-align: left;
    margin: 40px 0;
}

.hsq-results-details h3 {
    color: #1e1e1e;
    margin-bottom: 20px;
}

.hsq-scenario-list {
    list-style: none;
    padding: 0;
}

.hsq-scenario-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #dcdcde;
}

.hsq-scenario-correct {
    border-left-color: #00a32a;
    background: #f0f9f4;
}

.hsq-scenario-incorrect {
    border-left-color: #d63638;
    background: #fcf6f7;
}

.hsq-scenario-icon {
    font-size: 20px;
    margin-right: 15px;
    min-width: 24px;
}

.hsq-scenario-correct .hsq-scenario-icon {
    color: #00a32a;
}

.hsq-scenario-incorrect .hsq-scenario-icon {
    color: #d63638;
}

.hsq-scenario-subject {
    flex: 1;
    font-weight: 500;
    color: #2c3338;
}

.hsq-scenario-time {
    color: #646970;
    font-size: 14px;
}

/* User Stats */
.hsq-user-stats {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hsq-user-stats h3,
.hsq-user-stats h4 {
    color: #1e1e1e;
}

.hsq-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.hsq-stat-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.hsq-stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 5px;
}

.hsq-stat-label {
    font-size: 14px;
    color: #646970;
}

/* Results Table */
.hsq-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.hsq-results-table th,
.hsq-results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dcdcde;
}

.hsq-results-table th {
    background: #f0f0f1;
    font-weight: 600;
    color: #1e1e1e;
}

.hsq-result-correct {
    color: #00a32a;
    font-weight: 600;
}

.hsq-result-incorrect {
    color: #d63638;
    font-weight: 600;
}

/* Error Messages */
.hsq-error {
    background: #fcf0f1;
    color: #d63638;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    border-left: 4px solid #d63638;
}

/* Responsive */
@media (max-width: 768px) {
    .hsq-quiz-container {
        margin: 20px;
    }

    .hsq-quiz-intro,
    .hsq-quiz-content,
    .hsq-quiz-results {
        padding: 20px;
    }

    .hsq-actions {
        flex-direction: column;
    }

    .hsq-actions .hsq-btn {
        max-width: 100%;
    }

    .hsq-score {
        font-size: 48px;
    }

    .hsq-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
