:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-color);
    background-image: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.app-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.content-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    padding: 1.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Common Table/Grid Styles */
.assessment-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.assessment-table th, .assessment-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
}

.assessment-table th {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.assessment-table tbody tr:hover {
    background: #f9fafb;
}

/* SSFS Specific Styles */
.ssfs-title {
    font-weight: 600;
    white-space: nowrap;
}
.ssfs-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.ssfs-options {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ssfs-option-label {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0;
}
.ssfs-option-label input {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

/* ASQ Specific Styles */
.asq-question {
    font-size: 0.95rem;
}
.asq-table th.opt-col {
    width: 12%;
}
.asq-radio-cell {
    text-align: center;
}
.asq-radio-cell input {
    accent-color: var(--primary-color);
    transform: scale(1.2);
    cursor: pointer;
}

/* Categories header in table */
.table-category-header {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
}

.submit-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1; pointer-events: all;
}

.modal-content {
    background: #ffffff;
    width: 90%; max-width: 500px;
    max-height: 85vh; /* Prevent modal from exceeding screen height */
    overflow-y: auto; /* Enable scrolling if content is too long */
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute; top: 1rem; right: 1.5rem;
    font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--text-muted);
}

.modal-content h2 {
    color: var(--primary-color); margin-bottom: 1.5rem;
}

.report-section {
    background: #f8fafc; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.5rem;
}

.score-display {
    font-size: 1.1rem; margin-bottom: 0.5rem;
}
.score-display .highlight {
    font-size: 2.5rem; font-weight: 700; color: var(--primary-color);
}
.report-text {
    font-size: 1.05rem; color: #475569; line-height: 1.6;
    padding-top: 1rem; border-top: 1px dashed var(--border-color);
}

.btn-primary {
    background: var(--primary-color); color: white; border: none;
    padding: 0.75rem 2rem; font-size: 1rem; font-weight: 600;
    border-radius: 8px; cursor: pointer; transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .assessment-table th, .assessment-table td {
        padding: 0.5rem;
    }
    .ssfs-title {
        white-space: normal;
    }
    .asq-table th.opt-col {
        width: 14%; font-size: 0.75rem; padding: 0.2rem;
    }
}
