body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1, #8b5cf6);
    z-index: -1;
    border-radius: 0 0 30px 30px;
}

/* Header */
.header {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.logo {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logout-btn {
    position: absolute;
    right: 0;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.logo {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logout-btn {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Category Navigation */
.category-nav {
    margin-bottom: 30px;
    overflow-x: auto;
}

.category-list {
    display: flex;
    gap: 12px;
    padding: 4px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 12px 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(148, 163, 184, 0.4);
}

.category-btn.active {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

/* Materials Section */
.materials-section {
    animation: fadeIn 0.5s ease-out;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.material-count {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 14px;
    color: #94a3b8;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.material-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.material-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(2, 8, 20, 0.3);
}

.material-card-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.material-card-preview {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 8, 20, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    background: #1e293b;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(2, 8, 20, 0.4);
    margin: 20px auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #ffffff;
}

.modal-category {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-radius: 20px;
    font-size: 12px;
    color: #ffffff;
}

.modal-body {
    padding: 30px;
}

/* Material Content Styles */
.material-section {
    margin-bottom: 30px;
}

.material-section:last-child {
    margin-bottom: 0;
}

.material-section:last-child .section-content {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(14, 165, 233, 0.3);
    font-weight: 600;
}

.section-title-h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #0ea5e9, #6366f1) 1;
}

.section-content {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #cbd5e1;
    white-space: pre-wrap;
}

/* Annotation Styles */
.annotation {
    display: inline;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    margin: 0 2px;
    cursor: help;
    transition: all 0.2s ease;
}

.annotation:hover {
    background: rgba(139, 92, 246, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .materials-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }
}
