/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #4b5563;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #2563eb;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-small {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.page-subtitle {
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.input {
    resize: vertical;
    font-family: inherit;
}

/* Forms Grid */
.forms-grid {
    display: grid;
    gap: 1rem;
}

.form-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: start;
    transition: all 0.2s;
}

.form-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-card-content {
    flex: 1;
}

.form-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.form-card-description {
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.form-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.form-card-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    padding: 0.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.icon-btn:hover {
    background-color: #f3f4f6;
}

/* Section Builder */
.section-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f9fafb;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-number {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.125rem;
}

.questions-container {
    margin-top: 1rem;
}

.question-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.question-number {
    font-weight: 600;
    color: #6b7280;
}

.question-inputs {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 0.75rem;
}

/* Answer Buttons */
.answer-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.answer-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    background-color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-btn:hover {
    border-color: #9ca3af;
}

.answer-btn.selected-yes {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.answer-btn.selected-no {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

.answer-btn.selected-na {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Question Display */
.question-display {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.75rem;
}

.question-points {
    display: inline-block;
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Section Display */
.section-display {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #2563eb;
}

.section-score {
    background-color: #dbeafe;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}

.section-score-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e40af;
}

/* Results */
.results-banner {
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.results-banner.pass {
    background-color: #d1fae5;
    color: #065f46;
}

.results-banner.fail {
    background-color: #fee2e2;
    color: #991b1b;
}

.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.results-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.results-table tr:last-child td {
    border-bottom: 2px solid #2563eb;
    font-weight: 700;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pass {
    background-color: #d1fae5;
    color: #065f46;
}

.status-fail {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Responses Table */
.responses-table {
    width: 100%;
    border-collapse: collapse;
}

.responses-table th,
.responses-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.responses-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.responses-table tbody tr:hover {
    background-color: #f9fafb;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar label {
    font-weight: 500;
}

.filter-bar .input {
    width: auto;
    min-width: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #111827;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(200%);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-card {
        flex-direction: column;
    }

    .form-card-actions {
        margin-top: 1rem;
        width: 100%;
        justify-content: flex-end;
    }

    .question-inputs {
        grid-template-columns: 1fr;
    }

    .answer-buttons {
        flex-direction: column;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar .input {
        width: 100%;
    }
}

/* Detailed Breakdown */
.breakdown-section {
    margin-bottom: 2rem;
}

.breakdown-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
}

.breakdown-question {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.breakdown-question:last-child {
    border-bottom: none;
}

.breakdown-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    font-weight: 600;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .breakdown-question,
    .breakdown-header {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s;
}

.table-container {
    overflow-x: auto;
}
