/* Import Navigation CSS */
@import url('./navigation.css');

/* CSS Variables - WCAG AA Compliant Colors */
:root {
    /* Primary Colors - Enhanced for better contrast */
    --primary-color: #2563eb;          /* 6.14:1 contrast on white (was #3b82f6) */
    --primary-hover: #1d4ed8;          /* 7.45:1 contrast on white (was #2563eb) */
    --primary-light: #3b82f6;          /* Keep original for subtle accents */

    /* Secondary Colors */
    --secondary-color: #4b5563;        /* Updated for better contrast */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Background Colors */
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --hover-color: #f3f4f6;

    /* Text Colors - WCAG AA Compliant */
    --text-primary: #111827;           /* 18.95:1 contrast - Enhanced from #1f2937 */
    --text-secondary: #4b5563;         /* 7.07:1 contrast - Enhanced from #6b7280 */
    --text-muted: #6b7280;             /* 4.57:1 contrast - Keep for non-critical text */
    --text-white: #ffffff;

    /* Border Colors - Improved visibility */
    --border-color: #d1d5db;           /* Enhanced visibility from #e5e7eb */
    --border-light: #e5e7eb;           /* Keep for subtle dividers */
    --border-strong: #9ca3af;          /* For emphasized borders */

    /* Interactive States */
    --focus-ring: 2px solid var(--primary-color);
    --focus-offset: 2px;

    /* Layout & Effects */
    --border-radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Feature-specific Colors */
    --goal-achieved-color: #10b981;
    --goal-missing-color: #f59e0b;
    --analysis-bg: #f0f9ff;
    --analysis-border: #0ea5e9;

    /* High Contrast Mode Support */
    --high-contrast-bg: #000000;
    --high-contrast-text: #ffffff;
    --high-contrast-border: #ffffff;
}

/* High Contrast Mode Media Query */
@media (prefers-contrast: high) {
    :root {
        --text-primary: var(--high-contrast-text);
        --text-secondary: var(--high-contrast-text);
        --border-color: var(--high-contrast-border);
        --card-background: var(--high-contrast-bg);
        --background-color: var(--high-contrast-bg);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Enhanced Focus Indicators for Accessibility */
*:focus {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* Improved focus for interactive elements */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus,
[role="button"]:focus,
[role="menuitem"]:focus {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    transition: box-shadow 0.15s ease;
}

/* Focus for navigation items */
.nav-item:focus {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    background-color: var(--hover-color);
    z-index: 1;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
    border-radius: 4px;
    font-weight: 500;
}

.skip-to-content:focus {
    top: 6px;
    outline: 2px solid var(--text-white);
    outline-offset: 2px;
}

/* High contrast mode additional focus support */
@media (prefers-contrast: high) {
    *:focus {
        outline: 3px solid var(--high-contrast-border);
        outline-offset: 2px;
        background-color: var(--high-contrast-bg);
        color: var(--high-contrast-text);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: #eff6ff;
}

.logout-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-color);
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Access badge styles */
.access-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.access-badge.public {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

.access-badge.private {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

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

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 3rem;
}

.header-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-section p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: 9999px;
}

.badge-success {
    background-color: #d1fae5;
    color: var(--success-color);
}

.badge-secondary {
    background-color: #f3f4f6;
    color: var(--text-secondary);
}

.badge-primary {
    background-color: #dbeafe;
    color: var(--primary-color);
}

/* Forms Grid */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.form-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.form-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.form-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.form-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close:hover {
    color: var(--text-primary);
    background-color: var(--background-color);
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* AI Tools */
.ai-tools-section {
    margin-bottom: 3rem;
}

.ai-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.ai-tool-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.ai-tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.ai-tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Analysis Results */
.analysis-result,
.questions-result,
.form-analysis-result,
.realtime-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.analysis-result.success {
    border-left-color: var(--success-color);
    background-color: #f0fdf4;
}

.analysis-result.warning {
    border-left-color: var(--warning-color);
    background-color: #fffbeb;
}

.questions-list {
    list-style: none;
}

.questions-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.question-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Status Indicators */
.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
}

.status-indicator.analyzing {
    display: block;
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.status-indicator.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-indicator.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Form Selector */
.form-selector {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

.form-selector label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.form-selector select {
    flex: 1;
    max-width: 300px;
}

/* Real-time Tester */
.realtime-tester {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    
    .nav-links {
        margin-top: 1rem;
    }
    
    .header-section h2 {
        font-size: 2rem;
    }
    
    .ai-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .forms-grid {
        grid-template-columns: 1fr;
    }
    
    .form-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
}

/* Dynamic Form Styles */
.form-selection {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: end;
    margin-top: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.form-selector select {
    flex: 1;
    max-width: 300px;
}

.dynamic-form-section {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    text-align: center;
}

.form-header h2 {
    margin-bottom: 0.5rem;
}

.form-header p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.form-progress {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: white;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

.dynamic-form {
    padding: 2rem;
}

.form-fields {
    min-height: 200px;
    margin-bottom: 2rem;
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.step-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.step-fields {
    display: grid;
    gap: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.2s;
    background-color: var(--card-background);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Invalid field styling for conditional trigger fields */
.form-control.invalid,
input.invalid,
textarea.invalid,
select.invalid {
    border-color: var(--danger-color) !important;
    background-color: rgba(239, 68, 68, 0.05);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    30% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.rating-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rating-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.rating-label:hover {
    background-color: var(--background-color);
}

.rating-label input[type="radio"] {
    display: none;
}

.rating-star {
    font-size: 1.5rem;
    color: var(--border-color);
    transition: color 0.2s;
}

.rating-label input:checked ~ .rating-star,
.rating-label:hover .rating-star {
    color: #fbbf24;
}

.rating-number {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* AI Analysis Panel */
.ai-analysis-panel {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    width: 320px;
    z-index: 100;
}

.analysis-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.analysis-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.analysis-content {
    margin-top: 1rem;
}

/* Field Analysis Results */
.field-analysis {
    margin-bottom: 1rem;
}

.analysis-conclusion {
    padding: 0.75rem;
    background-color: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.analysis-conclusion h5 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.ai-insights {
    padding: 0.75rem;
    background-color: #f0fdf4;
    border-left: 4px solid var(--success-color);
    border-radius: 4px;
}

.ai-insights h5 {
    margin-bottom: 0.5rem;
    color: var(--success-color);
}

.ai-insights ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.ai-insights li {
    margin-bottom: 0.25rem;
}

/* Completion Analysis */
.completion-analysis {
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.completion-analysis h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.goals-analysis {
    margin-bottom: 1rem;
}

.completion-status {
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

.completion-status.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.completion-status.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.criteria-analysis ul,
.gaps-analysis ul {
    list-style: none;
    padding-left: 0;
}

.criteria-analysis li,
.gaps-analysis li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-background);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Dynamic Fields Styling */
.form-group input[data-trigger-field],
.form-group textarea[data-trigger-field] {
    border-left: 4px solid var(--warning-color);
    background-color: #fffbeb;
}

.form-group .dynamic-field-indicator {
    display: inline-block;
    background-color: var(--warning-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Submit button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
}

/* AI Analysis Panel Enhanced */
.ai-analysis-panel .analysis-card {
    max-height: 500px;
    overflow-y: auto;
}

/* Enhanced animations for AI feedback */
@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseOrange {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.analysis-conclusion {
    animation: pulseGreen 1.5s ease-in-out;
}

.completion-status.warning {
    animation: pulseOrange 1.5s ease-in-out;
}

/* Force Submit Option */
.force-submit-option {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--border-radius);
    text-align: center;
}

.force-submit-option p {
    margin-bottom: 0.5rem;
    color: #92400e;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* Form Completion */
.form-completion {
    text-align: center;
    padding: 3rem 2rem;
}

.completion-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.completion-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.followup-questions {
    margin: 2rem 0;
    text-align: left;
}

.followup-question {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.followup-question h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* AI Suggestion Modal */
.suggestion-content {
    padding: 1rem 0;
}

.suggestion-content h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.suggestion-content p {
    margin-bottom: 0.75rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Goal Analysis Styles */
.goal-analysis-summary {
    background: var(--analysis-bg);
    border: 2px solid var(--analysis-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.goal-analysis-summary .analysis-header h3 {
    color: var(--analysis-border);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.goal-analysis-summary .analysis-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.achieved-goals, .missing-goals {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.achieved-goals {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--goal-achieved-color);
}

.achieved-goals h4 {
    color: var(--goal-achieved-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.missing-goals {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--goal-missing-color);
}

.missing-goals h4 {
    color: var(--goal-missing-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.achieved-goals ul, .missing-goals ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.achieved-goals li, .missing-goals li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.achieved-goals li:last-child, .missing-goals li:last-child {
    border-bottom: none;
}

.additional-questions-intro {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.additional-questions-intro h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.additional-questions-intro p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Goal-generated field help text */
.form-field .field-help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* Enhanced field styling for goal questions */
.form-field[data-goal-generated="true"] {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: -1rem;
    background-color: rgba(59, 130, 246, 0.02);
}

.form-field[data-goal-generated="true"] label {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design for Dynamic Form */
@media (max-width: 1024px) {
    .ai-analysis-panel {
        position: static;
        transform: none;
        width: 100%;
        margin: 2rem 0;
    }
}

@media (max-width: 768px) {
    .form-selector {
        flex-direction: column;
    }
    
    .form-header {
        padding: 1.5rem 1rem;
    }
    
    .dynamic-form {
        padding: 1.5rem 1rem;
    }
    
    .completion-actions {
        flex-direction: column;
    }
    
    .rating-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
}

/* Enhanced Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.form-fields {
    animation: fadeInUp 0.3s ease;
}

.ai-analysis-panel {
    animation: slideInRight 0.3s ease;
}

/* Hide scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Original Value Display Styling */
.original-value-display {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.original-value-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.original-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.original-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.original-image-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.original-image-preview:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.original-file-info {
    margin-top: 0.5rem;
}

.original-file-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-word;
    display: block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.original-text-value {
    padding: 0.75rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Image Popup Modal Styling */
.image-popup-content {
    max-width: 90vw;
    max-height: 90vh;
}

.image-popup-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    max-height: 80vh;
    overflow: hidden;
}

.popup-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Responsive design for original value display */
@media (max-width: 768px) {
    .original-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .original-image-preview {
        height: 60px;
    }

    .original-file-name {
        font-size: 0.7rem;
        max-width: 80px;
    }

    .image-popup-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 2.5% auto;
    }

    .image-popup-body {
        padding: 0.5rem;
        max-height: 75vh;
    }
}

/* Field Suggestions Styling */
.field-suggestion {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.field-suggestion.improvement {
    background-color: #fef3c7;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.field-suggestion.encouragement {
    background-color: #d1fae5;
    border-left-color: var(--success-color);
    color: #065f46;
}

/* Form Access Link Styling */
.form-access-link {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-access-link label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.link-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-container input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: var(--card-background);
    color: var(--text-secondary);
}

.link-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* External link mode - clean layout without navbar */
body.external-link {
    padding-top: 0;
}

body.external-link .main-content {
    padding-top: 2rem;
}

/* Centered form for external access */
.external-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Make form header more prominent for external users */
.external-link .form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.external-link .dynamic-form-section {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Hide AI analysis panel for external users */
.external-link .ai-analysis-panel {
    display: none !important;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Real-time AI Analysis Styles */
.realtime-insights {
    margin-top: 1rem;
    animation: fadeInUp 0.3s ease;
}

.ai-insights-realtime {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--border-radius);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.ai-insights-realtime::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), #06b6d4);
}

.insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.insights-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.insights-title {
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
}

.word-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.insights-content {
    padding-left: 0.5rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.confidence-indicator {
    margin-top: 0.75rem;
    padding-left: 0.5rem;
}

.confidence-bar {
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), #06b6d4);
    border-radius: 2px;
    transition: width 0.5s ease;
    display: block;
}

/* AI Insights Loading State */
.ai-insights-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    margin-top: 1rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Follow-up Questions Styles */
.realtime-followups {
    margin-top: 1.5rem;
    animation: fadeInUp 0.4s ease;
}

.followup-questions-container {
    background-color: #fefce8;
    border: 1px solid #fde047;
    border-radius: var(--border-radius);
    padding: 1rem;
    position: relative;
}

.followup-questions-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--warning-color);
    border-radius: 2px 0 0 2px;
}

.followup-questions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.followup-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.followup-title {
    font-weight: 600;
    color: #a16207;
    flex: 1;
}

.dismiss-all-btn {
    background: none;
    border: 1px solid #fbbf24;
    color: #a16207;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dismiss-all-btn:hover {
    background-color: #fbbf24;
    color: white;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

/* Individual Follow-up Question */
.followup-question {
    background-color: white;
    border: 1px solid #fde047;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.followup-question:hover {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    transform: translateY(-1px);
}

.followup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.priority-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-high {
    background-color: var(--danger-color);
}

.priority-medium {
    background-color: var(--warning-color);
}

.priority-low {
    background-color: var(--success-color);
}

.add-question-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-question-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.question-preview {
    padding-left: 0.25rem;
}

.question-preview strong {
    color: var(--text-primary);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.question-reasoning {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    font-style: italic;
}

/* Animation for removing follow-up questions */
.followup-question.removing {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

/* Responsive Design for Real-time Analysis */
@media (max-width: 768px) {
    .followup-questions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .followup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .add-question-btn {
        align-self: flex-end;
    }
    
    .insights-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Enhanced fade animation for dynamic content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FILE UPLOAD STYLES
   ============================================ */

.file-upload-container {
    margin-top: 0.5rem;
}

.file-input {
    display: none;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background-color: var(--background-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
    transform: translateY(-1px);
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #e0f2fe;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.file-upload-area p {
    margin: 0.5rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

.file-upload-area small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), #06b6d4);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* File Previews */
.file-preview,
.image-preview-grid,
.video-preview-grid,
.audio-preview-list,
.document-preview-list {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    min-height: 60px;
}

.file-preview:empty,
.image-preview-grid:empty,
.video-preview-grid:empty,
.audio-preview-list:empty,
.document-preview-list:empty {
    display: none;
}

.file-preview-item {
    position: relative;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.remove-file-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.remove-file-btn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Image Preview */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.image-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-preview img:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.file-info {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.file-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Video Preview */
.video-preview video {
    width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius);
}

/* Audio Preview */
.audio-preview audio {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Document Preview */
.file-preview-generic {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.file-preview-generic .file-info {
    flex: 1;
    margin: 0;
}

.file-link {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* AI File Analysis */
.ai-file-analysis {
    margin-top: 1rem;
}

.file-ai-analysis-item {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f7fa 100%);
    border: 1px solid #a7f3d0;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.file-ai-analysis-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--success-color);
    border-radius: 2px 0 0 2px;
}

.file-analysis-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.analysis-icon {
    font-size: 1.25rem;
}

.analysis-title {
    font-weight: 600;
    color: var(--success-color);
    flex: 1;
}

.analysis-content {
    padding-left: 0.5rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.analysis-followups {
    padding-left: 0.5rem;
    border-top: 1px solid #a7f3d0;
    padding-top: 0.75rem;
}

.analysis-followups ul {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.analysis-followups li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.add-followup-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-followup-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Field Type Specific Styles */
.radio-group,
.checkboxes-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-background);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 0.5rem;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.checkbox-option input[type="checkbox"],
.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
    pointer-events: none; /* Let clicks pass through to label */
}

.checkbox-option label,
.radio-option label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
    line-height: 1.4;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0.875rem;
    display: flex;
    align-items: center;
    padding-left: 3rem; /* Space for radio button */
}

.checkbox-option:has(input:checked),
.radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
    box-shadow: none; /* Remove black outline */
}

.checkbox-option:has(input:checked) label,
.radio-option:has(input:checked) label {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.checkbox-wrapper:hover {
    border-color: var(--primary-color);
}

.color-picker {
    width: 100px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 2px solid var(--border-color) !important;
    cursor: pointer;
}

/* Responsive Design for File Uploads */
@media (max-width: 768px) {
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .image-preview img {
        height: 120px;
    }
    
    .file-preview-generic {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .analysis-followups li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .add-followup-btn {
        align-self: flex-end;
    }
}

/* Tab Navigation Styles */
.tabs-section {
    margin: 2rem 0 1rem 0;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.tab-content {
    display: none;
}

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

/* Table Styles */
.table-container {
    margin: 1rem 0;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

/* Horizontal scroll styling for webkit browsers */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--background-color);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

.data-table th {
    background-color: var(--background-color);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    min-width: 120px;
}

.data-table th:first-child {
    min-width: 200px;
}

.data-table th:nth-child(2) {
    min-width: 250px;
}

.data-table th:last-child {
    min-width: 150px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: var(--background-color);
}

/* Table cell content styles */
.table-cell-content {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-cell-content.wide {
    max-width: 300px;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active,
.status-badge.completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.draft {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
}

.text-muted {
    color: var(--text-secondary) !important;
    opacity: 0.7;
}

/* Submission details styles */
.submission-details {
    display: grid;
    gap: 1.5rem;
}

.detail-section {
    background: var(--background-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.detail-section h4 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.response-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.response-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.response-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.response-value {
    color: var(--text-secondary);
    word-wrap: break-word;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
}

.metadata-item .label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.metadata-item .value {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Responsive table */
@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
    }

    .tab-btn {
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        border-right: none;
    }

    .tab-btn.active {
        border-left: 3px solid var(--primary-color);
        border-bottom: 1px solid var(--border-color);
    }

    .table-container {
        border-radius: 0;
        margin: 1rem -1rem;
    }

    .data-table {
        font-size: 0.8rem;
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .data-table th {
        min-width: 100px;
    }

    .data-table th:first-child {
        min-width: 150px;
    }

    .data-table th:nth-child(2) {
        min-width: 180px;
    }

    .data-table th:last-child {
        min-width: 120px;
    }

    .table-cell-content {
        max-width: 120px;
    }

    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .table-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Add scroll indicator for mobile */
    .table-container::after {
        content: "← Scroll to see more →";
        position: sticky;
        right: 0;
        bottom: 8px;
        background: rgba(59, 130, 246, 0.1);
        color: var(--primary-color);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.75rem;
        text-align: center;
        display: block;
        z-index: 1;
    }

    /* Question Flow Blocks - Responsive */
    .question-flow-blocks {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }

    .question-flow-block {
        padding: 1rem;
        border-width: 1px;
    }

    .question-flow-block .question-group-title h4 {
        font-size: 1.1rem;
    }
}

/* Question Flow Blocks */
.question-flow-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.question-flow-block {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow-wrap: break-word;
}

.question-flow-block .question-group-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.question-flow-block .question-group-title h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.question-flow-complete {
    text-align: center;
    color: var(--success-color);
    font-weight: 600;
    padding: 1rem;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius);
}

/* Question Flow Group Title (legacy) */
.question-group-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.question-group-title h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Info Field (read-only information display) */
.info-field {
    margin: 1rem 0;
}

.info-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.info-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.info-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

/* Question Flow Next Button */
.btn-question-next {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

.btn-question-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn-question-next:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-question-next:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.question-flow-controls {
    margin-top: 1.5rem;
}

/* Edit Link Input Focus Styling - CSP Compliant */
.edit-link-input:focus {
    border-color: var(--primary-color);
    outline: none;
}