/* ========================================
   MOSFET 3D Visualization - Main Styles
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-blue: #4db8ff;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;
    --accent-orange: #f97316;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(77, 184, 255, 0.3);
    --gradient-blue-purple: linear-gradient(135deg, #4db8ff 0%, #a855f7 100%);
    --gradient-cyan-blue: linear-gradient(135deg, #22d3ee 0%, #4db8ff 100%);
    --shadow-glow: 0 0 40px rgba(77, 184, 255, 0.15);
    --font-main: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Hero Section (3D Viewer)
   ======================================== */
.hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

#logo {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 100px;
    height: auto;
    z-index: 10;
    transition: width 0.3s ease;
}

#info-panel {
    position: absolute;
    top: 30px;
    right: 30px;
    text-align: right;
    color: white;
    max-width: 450px;
    pointer-events: none;
    transition: var(--transition-smooth);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#info-panel h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#info-panel p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.highlight {
    color: var(--accent-blue);
    font-weight: bold;
}

.model-subtitle {
    display: block;
    font-size: 16px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* UI Container - Button Bar */
#ui-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    z-index: 100;
    width: auto;
    max-width: 90vw;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

#ui-container::-webkit-scrollbar {
    display: none;
}

.btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

/* ========================================
   Scroll Indicator
   ======================================== */
.scroll-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 50;
    animation: fadeInUp 1s ease 1s both;
}

.scroll-indicator span {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: rotate(45deg) translateY(0);
    }

    40% {
        transform: rotate(45deg) translateY(10px);
    }

    60% {
        transform: rotate(45deg) translateY(5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   Education Section
   ======================================== */
.education-section {
    position: relative;
    min-height: 100vh;
    background: var(--bg-secondary);
    padding: 100px 20px;
}

.education-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, var(--bg-primary), transparent);
    pointer-events: none;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 80px;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-size: 48px;
    font-weight: 200;
    letter-spacing: 4px;
    margin-bottom: 20px;
    background: var(--gradient-blue-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========================================
   Timeline
   ======================================== */
.timeline {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 40px 100px;
}

/* Vertical Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 80px;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent,
            var(--accent-blue) 5%,
            var(--accent-purple) 50%,
            var(--accent-cyan) 95%,
            transparent);
    top: 0;
}

.timeline-item {
    position: relative;
    width: 100%;
    padding: 20px 0 20px 60px;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Remove alternating layout - all cards on right */
.timeline-item:nth-child(odd),
.timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
    padding-left: 60px;
    padding-right: 0;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    top: 40px;
    left: -70px;
    z-index: 10;
    box-shadow: 0 0 20px var(--accent-blue);
    transition: var(--transition-smooth);
}

/* Year label on timeline */
.timeline-dot::after {
    content: '';
    position: absolute;
    left: 23px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--accent-blue), transparent);
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 30px var(--accent-blue);
}

.timeline-item:nth-child(2) .timeline-dot {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan);
}

.timeline-item:nth-child(3) .timeline-dot {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px var(--accent-purple);
}

.timeline-item:nth-child(4) .timeline-dot {
    border-color: var(--accent-orange);
    box-shadow: 0 0 20px var(--accent-orange);
}

/* ========================================
   Timeline Card
   ======================================== */
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.timeline-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.timeline-year {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(77, 184, 255, 0.1);
    border-radius: 20px;
}

.timeline-item:nth-child(2) .timeline-year {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
}

.timeline-item:nth-child(3) .timeline-year {
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.1);
}

.timeline-item:nth-child(4) .timeline-year {
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
}

.timeline-card h3 {
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.3;
}

.timeline-card .persons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.person-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.person-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
}

.person-tag svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.timeline-card .story {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

/* Image Container */
.timeline-image {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(77, 184, 255, 0.1), rgba(168, 85, 247, 0.1));
}

.timeline-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.timeline-card:hover .timeline-image img {
    transform: scale(1.05);
}

.timeline-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

/* Features */
.features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(77, 184, 255, 0.08);
    border: 1px solid rgba(77, 184, 255, 0.2);
    border-radius: 12px;
    font-size: 13px;
    color: var(--accent-blue);
    transition: var(--transition-smooth);
}

.feature-tag:hover {
    background: rgba(77, 184, 255, 0.15);
    transform: translateY(-2px);
}

.timeline-item:nth-child(2) .feature-tag {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.2);
    color: var(--accent-cyan);
}

.timeline-item:nth-child(3) .feature-tag {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

.timeline-item:nth-child(4) .feature-tag {
    background: rgba(249, 115, 22, 0.08);
    border-color: rgba(249, 115, 22, 0.2);
    color: var(--accent-orange);
}

/* Card Subtitle */
.card-subtitle {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 400;
}

/* ========================================
   Inventor Section
   ======================================== */
.inventor-section {
    margin: 24px 0;
    text-align: left;
}

.inventor-section h4,
.story-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.inventor-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inventor-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    transition: var(--transition-smooth);
}

.inventor-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.inventor-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.inventor-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.inventor-life,
.inventor-origin {
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.inventor-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
    text-align: left;
}

/* ========================================
   Story Section
   ======================================== */
.story-section {
    margin: 24px 0;
    text-align: left;
}

.story-section .story {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 16px;
    text-align: left;
}

.story-section .story:last-of-type {
    margin-bottom: 0;
}

.story-section .story strong {
    color: var(--text-primary);
    font-weight: 600;
}

.story-section .highlight-text {
    background: linear-gradient(135deg, rgba(77, 184, 255, 0.08), rgba(168, 85, 247, 0.08));
    border-left: 3px solid var(--accent-blue);
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    margin-top: 20px;
}

.timeline-item:nth-child(2) .story-section .highlight-text {
    border-left-color: var(--accent-cyan);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(77, 184, 255, 0.08));
}

.timeline-item:nth-child(3) .story-section .highlight-text {
    border-left-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(77, 184, 255, 0.08));
}

.timeline-item:nth-child(4) .story-section .highlight-text {
    border-left-color: var(--accent-orange);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(168, 85, 247, 0.08));
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .timeline {
        padding: 40px 20px 40px 60px;
    }

    .timeline::before {
        left: 40px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-dot {
        left: -58px;
    }
}

@media (max-width: 768px) {
    #ui-container {
        bottom: 20px;
        padding: 6px 10px;
        gap: 6px;
        width: auto;
        max-width: 98vw;
        justify-content: center;
        flex-wrap: nowrap;
    }

    .btn {
        padding: 5px 8px;
        font-size: 10px;
        border-radius: 12px;
        flex: 0 1 auto;
        text-align: center;
    }

    #logo {
        top: 20px;
        left: 20px;
        width: 70px;
    }

    #info-panel {
        top: 20px;
        right: 20px;
        max-width: 200px;
    }

    #info-panel h1 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    #info-panel p {
        font-size: 11px;
        line-height: 1.4;
    }

    .model-subtitle {
        font-size: 12px;
    }

    .scroll-indicator {
        bottom: 80px;
    }

    .section-header h2 {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .section-header p {
        font-size: 15px;
    }

    .timeline {
        padding: 40px 15px 40px 40px;
    }

    .timeline::before {
        left: 25px;
    }

    .timeline-item {
        padding-left: 35px;
    }

    .timeline-dot {
        left: -42px;
        width: 16px;
        height: 16px;
    }

    .timeline-card {
        padding: 20px;
        border-radius: 18px;
    }

    .timeline-card h3 {
        font-size: 20px;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.section-header h2 {
    background-size: 200% 200%;
    animation: gradientFlow 6s ease infinite;
}