* {
    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: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.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;
}

/* 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;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#statusText {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 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;
}

/* 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: 1000px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.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;
}

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

.pain-point-detail p {
    margin-bottom: 8px;
}

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

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

/* 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;
    }
}

/* 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;
    }
}
