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

:root {
    --ucla-blue: #2774AE;
    --widget-bg: #000000;
    --text-color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    min-height: 100vh;
}

/* Widget Container */
.widget-container {
    background-color: var(--widget-bg);
    color: var(--text-color);
    max-width: 1400px;
    margin: 0 auto;
    height: 800px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.widget-container:fullscreen {
    height: 100vh;
    border-radius: 0;
}

/* Landing Overlay */
.landing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--ucla-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    transition: transform 0.8s cubic-bezier(0.65, 0.05, 0.36, 1);
}

.landing-overlay.hidden {
    transform: translateY(-100%);
}

.ucla-logo-landing {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    letter-spacing: 2px;
}

.landing-title {
    font-size: 48px;
    font-weight: 300;
    color: var(--text-color);
    text-align: center;
    letter-spacing: 3px;
    margin: 0;
    line-height: 1.2;
}

.landing-subtitle {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-color);
    text-align: center;
    letter-spacing: 2px;
    margin: 15px 0 0 0;
    opacity: 0.8;
}

.landing-arrow {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    color: rgba(255, 255, 255, 0.4);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Header Bar */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ucla-logo-placeholder {
    width: 40px;
    height: 40px;
    background-color: var(--ucla-blue);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
}

.header-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-color);
}

.maximize-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-color);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
}

.maximize-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--ucla-blue);
}

.maximize-btn svg {
    stroke: currentColor;
}

/* Widget Body */
.widget-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Table of Contents Panel */
.toc-panel {
    background-color: var(--widget-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.toc-panel.expanded {
    width: 280px;
}

.toc-panel.collapsed {
    width: 50px;
}

.toc-toggle {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    padding: 15px;
    cursor: pointer;
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.toc-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.toc-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.toc-panel.collapsed .toc-content {
    display: none;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-item {
    margin: 0;
}

.toc-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.toc-link.active {
    background-color: rgba(39, 116, 174, 0.2);
    border-left-color: var(--ucla-blue);
    color: var(--ucla-blue);
}

.toc-sublist {
    list-style: none;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.3);
}

.toc-sublink {
    display: block;
    padding: 8px 20px 8px 40px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-sublink:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.toc-sublink.active {
    background-color: rgba(39, 116, 174, 0.2);
    border-left-color: var(--ucla-blue);
    color: var(--ucla-blue);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 40px;
    background-color: var(--widget-bg);
}

.content-section {
    margin-bottom: 60px;
    scroll-margin-top: 20px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--ucla-blue);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ucla-blue);
}

.subsection {
    margin-bottom: 40px;
    margin-left: 20px;
}

.subsection-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.content-heading {
    font-size: 20px;
    font-weight: 600;
    color: var(--ucla-blue);
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-heading:first-of-type {
    margin-top: 0;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ucla-blue);
    margin-top: 25px;
    margin-bottom: 5px;
}

.author-title {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-bottom: 15px;
}

.resource-list {
    margin-top: 20px;
}

.resource-item {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.resource-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.resource-name a {
    color: var(--ucla-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.resource-name a:hover {
    color: #4a9ae8;
    text-decoration: underline;
}

.resource-description {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.accordion-container {
    margin-top: 25px;
}

.accordion-item {
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.accordion-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--ucla-blue);
    padding: 15px 20px;
    cursor: pointer;
    background-color: rgba(39, 116, 174, 0.1);
    list-style: none;
    transition: background-color 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background-color: rgba(39, 116, 174, 0.2);
}

.accordion-header::-webkit-details-marker {
    display: none;
}

.accordion-header::before {
    content: "▶";
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.2s ease;
    color: var(--ucla-blue);
}

.accordion-item[open] .accordion-header::before {
    transform: rotate(90deg);
}

.accordion-content {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
}

.resource-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-link-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
}

.resource-link-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--ucla-blue);
    font-weight: bold;
}

.resource-link-list li:last-child {
    margin-bottom: 0;
}

.resource-link-list a {
    color: var(--ucla-blue);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.6;
    transition: color 0.2s ease;
}

.resource-link-list a:hover {
    color: #4a9ae8;
    text-decoration: underline;
}

.reading-gallery-container {
    margin-top: 30px;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ucla-blue) rgba(255, 255, 255, 0.1);
    padding: 10px 0;
}

.reading-gallery-container::-webkit-scrollbar {
    height: 8px;
}

.reading-gallery-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.reading-gallery-container::-webkit-scrollbar-thumb {
    background: var(--ucla-blue);
    border-radius: 4px;
}

.reading-gallery-container::-webkit-scrollbar-thumb:hover {
    background: #4a9ae8;
}

.reading-gallery {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    min-width: min-content;
}

.reading-item {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    transition: transform 0.2s ease;
}

.reading-item:hover {
    transform: scale(1.05);
}

.reading-item a {
    display: block;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

.reading-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease;
}

.reading-item:hover img {
    box-shadow: 0 4px 12px rgba(39, 116, 174, 0.4);
}

.placeholder-text {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.user-note {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.feedback-button {
    display: inline-block;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--ucla-blue);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid var(--ucla-blue);
    letter-spacing: 0.5px;
}

.feedback-button:hover {
    background-color: transparent;
    color: var(--ucla-blue);
    border-color: var(--ucla-blue);
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar,
.toc-content::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
.toc-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.content-area::-webkit-scrollbar-thumb,
.toc-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.toc-content::-webkit-scrollbar-thumb:hover {
    background: var(--ucla-blue);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .widget-container {
        height: 600px;
    }

    .toc-panel.expanded {
        width: 240px;
    }

    .content-area {
        padding: 20px;
    }

    .section-title {
        font-size: 24px;
    }

    .subsection-title {
        font-size: 18px;
    }

    .reading-item {
        width: 150px;
        height: 225px;
    }

    .reading-gallery {
        gap: 15px;
    }

    .tableauViz {
        height: 500px !important;
    }

    .landing-title {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .ucla-logo-landing {
        top: 30px;
        font-size: 20px;
    }

    .landing-arrow {
        bottom: 40px;
        font-size: 24px;
    }
}
