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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Navigation Bar */
nav {
    background: linear-gradient(135deg, #5a6fc8 0%, #6b3f96 100%);
    backdrop-filter: blur(10px);
    background-color: rgba(90, 111, 200, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-brand:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.nav-brand-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.nav-links li {
    position: relative;
}

.nav-links a,
.nav-links button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 3px;
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* Main Content */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        height: 60px;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #5a6fc8 0%, #6b3f96 100%);
        flex-direction: column;
        gap: 0;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.active {
        max-height: 500px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a,
    .nav-links button {
        width: 100%;
        padding: 12px 20px;
        border-radius: 0;
        justify-content: flex-start;
    }

    .nav-divider {
        display: none;
    }

    .container {
        padding: 20px;
    }
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

/* Upload Section */
.upload-section {
    padding: 60px 40px;
    text-align: center;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 60px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ecff;
    transform: scale(1.02);
}

.upload-icon {
    width: 60px;
    height: 60px;
    color: #667eea;
    margin-bottom: 20px;
    stroke-width: 1.5;
}

.upload-area h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.upload-area p {
    color: #666;
    font-size: 1rem;
}

.upload-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 60px 40px;
    animation: fadeInUp 0.5s ease-out;
    position: relative;
    z-index: 10;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

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

/* Modern Spinner */
.modern-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: spinRing 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #667eea;
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #764ba2;
    animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #667eea;
    animation-delay: -0.15s;
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: corePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
}

@keyframes corePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

#statusText {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textFade 2s ease-in-out infinite;
    margin: 20px 0 10px 0;
}

@keyframes textFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: dotJump 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotJump {
    0%, 80%, 100% {
        transform: scale(0.8) translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3) translateY(-10px);
        opacity: 1;
    }
}

/* Results Section */
.results-section {
    padding: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h2 {
    font-size: 1.8rem;
    color: #333;
}

/* Student Card */
.student-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 15px;
}

.card-row:last-child {
    margin-bottom: 0;
}

.card-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-item p {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.card-item p.empty {
    color: #999;
    font-style: italic;
}

/* Disability Categories */
.disability-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.disability-category-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.disability-category-btn:disabled {
    opacity: 1;
    cursor: default;
}

.disability-category-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Collapsible Sections */
.sections-container {
    margin-bottom: 30px;
}

.collapsible-section {
    border-bottom: 1px solid #e0e0e0;
}

.collapsible-section:last-child {
    border-bottom: none;
}

.section-header {
    width: 100%;
    padding: 18px 25px;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.section-header:hover {
    background: #f8f9ff;
}

.section-header h3 {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.toggle-icon {
    display: inline-block;
    width: 20px;
    color: #667eea;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.section-header.open .toggle-icon {
    transform: rotate(90deg);
}

.section-content {
    padding: 0 25px;
    max-height: none;
    overflow: visible;
    transition: all 0.3s ease;
}

.section-content.open {
    padding: 20px 25px;
    overflow: visible;
}

.content-empty {
    color: #999;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

/* Item Boxes - Clean layout for extracted data */
.item-box {
    background: #f8f9ff;
    border-left: 3px solid #667eea;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.item-box:hover {
    background: #f0f2ff;
    border-left-color: #764ba2;
}

.item-box:last-child {
    margin-bottom: 0;
}

.item-label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.item-value {
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Pain Point Boxes */
.pain-point-box {
    background: #fff9f5;
    border-left: 4px solid #e67e22;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pain-point-box:hover {
    background: #ffe8d6;
    border-left-color: #d35400;
}

.pain-point-box:last-child {
    margin-bottom: 0;
}

.pain-point-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pain-point-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pain-point-issue {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.pain-point-detail {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pain-point-detail p {
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pain-point-detail p:last-child {
    margin-bottom: 0;
}

.pain-point-detail strong {
    color: #333;
    font-weight: 600;
}

.pain-point-reference {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
}

.pain-point-reference strong {
    color: #667eea;
    font-weight: 600;
}

.reference-text {
    color: #764ba2;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Tables */
.fields-table {
    width: 100%;
    border-collapse: collapse;
}

.fields-table th {
    background: #f0f0f0;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.fields-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.fields-table tr:hover {
    background: #f8f9ff;
}

.field-key {
    color: #667eea;
    font-weight: 500;
}

/* Buttons */
.btn-export,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-top: 10px;
}

.btn-export {
    background: #667eea;
    color: white;
}

.btn-export:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.export-options {
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    margin-top: 30px;
}

/* Error Section */
.error-section {
    padding: 40px;
    text-align: center;
}

.error-box {
    background: #fff5f5;
    border-left: 4px solid #f56565;
    border-radius: 8px;
    padding: 30px;
}

.error-box h3 {
    color: #f56565;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.error-box p {
    color: #c53030;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Chart Container */
#goalsVisualization {
    padding: 20px 0;
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .card-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        padding: 15px 15px;
    }

    .section-content {
        padding: 0 15px;
    }

    .btn-export,
    .btn-secondary {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .item-box {
        padding: 12px;
    }
}

/* 2-column layouts for various sections */
#accommodationsContent,
#servicesContent,
#goalsContent,
#performanceContent {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    #accommodationsContent,
    #servicesContent,
    #goalsContent,
    #performanceContent {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .header {
        color: #333;
        border-bottom: 2px solid #333;
        padding-bottom: 20px;
        margin-bottom: 30px;
    }

    .upload-section,
    .export-options,
    .results-header button {
        display: none;
    }

    .collapsible-section {
        page-break-inside: avoid;
    }

    .section-content {
        display: block !important;
        padding: 15px 0 !important;
    }
}
