* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #333;
}

.overall-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
}

.progress-bar-container {
    width: 300px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.button-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-reset {
    background: #f44336;
    color: white;
}

.btn-reset:hover {
    background: #d32f2f;
}

.btn-export {
    background: #2196F3;
    color: white;
}

.btn-export:hover {
    background: #1976D2;
}

.btn-pass-all {
    background: #4CAF50;
    color: white;
}

.btn-pass-all:hover {
    background: #388E3C;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.category {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.category-header {
    padding: 12px 16px;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header .category-title {
    font-size: 1rem;
}

.category-header .category-percent {
    font-size: 0.9rem;
    opacity: 0.9;
}

.category-functional .category-header {
    background: #4CAF50;
}

.category-pedagogical .category-header {
    background: #2196F3;
}

.category-technical .category-header {
    background: #FF9800;
}

.category-assessment .category-header {
    background: #9C27B0;
}

.test-items {
    padding: 8px 0;
    background: white;
}

.test-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-left: 3px solid transparent;
}

.test-item:hover {
    background-color: #f5f5f5;
}

.test-item.passed {
    border-left-color: #4CAF50;
    background-color: #E8F5E9;
}

.test-item.failed {
    border-left-color: #f44336;
    background-color: #FFEBEE;
}

.test-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    margin-top: 2px;
}

.test-item.passed .test-checkbox {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.test-item.failed .test-checkbox {
    background: #f44336;
    border-color: #f44336;
    color: white;
}

.test-content {
    flex: 1;
}

.test-name {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 2px;
}

.test-description {
    font-size: 0.75rem;
    color: #666;
    display: none;
}

.test-item:hover .test-description,
.test-item:focus .test-description {
    display: block;
}

.status-indicator {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 2px;
}

.status-untested {
    background: #e0e0e0;
    color: #666;
}

.status-pass {
    background: #C8E6C9;
    color: #2E7D32;
}

.status-fail {
    background: #FFCDD2;
    color: #C62828;
}

.export-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.export-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.export-textarea {
    width: 100%;
    height: 300px;
    font-family: monospace;
    font-size: 0.85rem;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.copy-btn {
    margin-top: 10px;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.copy-btn:hover {
    background: #388E3C;
}

footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

/* Keyboard focus styles */
.test-item:focus {
    outline: 2px solid #2196F3;
    outline-offset: -2px;
}

.btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 12px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .score-display {
        font-size: 2rem;
    }

    .progress-bar-container {
        width: 200px;
    }
}
