/* Component-specific styles */

/* Test Interface */
.test-interface {
    max-width: 1000px;
    margin: 0 auto;
}

.test-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.test-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.test-info {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.test-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-questions {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.question {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.question:last-child {
    border-bottom: none;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.question-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.question-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.question-input.error {
    border-color: var(--danger-color);
}

.test-actions {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
}

/* Results Display */
.results-container {
    text-align: center;
    padding: 2rem;
}

.score-display {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.score-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.pass-badge {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--success-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.fail-badge {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--danger-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

/* Progress Table */
.progress-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.progress-table th,
.progress-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.progress-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
}

.progress-table tr:hover {
    background: var(--bg-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* PDF Viewer */
.pdf-viewer-container {
    width: 100%;
    height: 80vh;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.pdf-viewer-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Certificate Preview */
.certificate-preview {
    background: white;
    padding: 2rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
}

.certificate-preview h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.certificate-details {
    margin: 2rem 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.certificate-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

/* Learning Material Viewer */
.learning-viewer {
    max-width: 1000px;
    margin: 0 auto;
}

.learning-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.learning-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.learning-content h3 {
    color: var(--primary-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.learning-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.learning-content ul,
.learning-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.learning-content li {
    margin-bottom: 0.5rem;
}

.learning-content code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.learning-content pre {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.learning-content pre code {
    background: none;
    padding: 0;
}

/* Navigation Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Test Review */
.test-review {
    max-width: 1200px;
    margin: 0 auto;
}

.test-review table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.test-review th {
    background: #4472C4;
    color: white;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

.test-review td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    vertical-align: top;
}

.test-review tr:nth-child(even) {
    background: #f9f9f9;
}

.test-review tr:hover {
    background: #f0f0f0;
}

/* Test Cell Input Focus */
.test-cell-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: #f0f7ff;
}

.test-cell-input {
    transition: all 0.2s ease;
}

/* Results Summary */
.results-summary {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.results-summary h3 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Info Bubble/Tooltip System */
.info-bubble {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #4472C4;
    text-decoration: underline;
    text-decoration-style: dotted;
    border-bottom: 1px dotted #4472C4;
}

.info-bubble:hover {
    color: #2c5aa0;
}

.info-bubble-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    width: 300px;
    max-width: 90vw;
    z-index: 1000;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.info-bubble-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.info-bubble:hover .info-bubble-tooltip {
    visibility: visible;
    opacity: 1;
}

.info-bubble-tooltip strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 1rem;
}

.info-bubble-tooltip ul {
    margin: 0.5rem 0 0 1.2rem;
    padding: 0;
}

.info-bubble-tooltip li {
    margin-bottom: 0.25rem;
}

/* Expandable Info Boxes */
.expandable-info {
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.expandable-info-header {
    background: #f5f5f5;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #4472C4;
}

.expandable-info-header:hover {
    background: #e8e8e8;
}

.expandable-info-content {
    padding: 1rem;
    background: white;
    display: none;
}

.expandable-info.expanded .expandable-info-content {
    display: block;
}

.expandable-info.expanded .expandable-info-header::after {
    content: "−";
}

.expandable-info-header::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: bold;
}

/* Print Styles */
@media print {
    .navbar,
    .test-actions,
    .btn {
        display: none;
    }
    
    .test-interface,
    .learning-content {
        box-shadow: none;
    }
    
    .info-bubble-tooltip {
        display: none;
    }
}

