/* CSS Reset & Variables */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --font-sans: 'Inter', 'Noto Sans TC', sans-serif;
    --sidebar-width: 320px;
    --border-radius: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

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

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar / Header */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.avatar-container {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.avatar-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    margin: 24px 0;
}

.contact-list {
    list-style: none;
    width: 100%;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.contact-list a:hover {
    color: var(--accent);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-primary);
    color: var(--accent);
    padding-left: 20px;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 60px 80px;
    max-width: 1000px;
}

/* Section Common Styling */
.section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
}

/* About Section CSS */
.about-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* Timeline/Experience Styling */
.timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    padding-left: 24px;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

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

.timeline-dot {
    position: absolute;
    left: -33px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 8px var(--accent);
}

.timeline-header {
    margin-bottom: 12px;
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.job-desc {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.job-bullets {
    list-style-type: none;
}

.job-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.job-bullets li::before {
    content: "•";
    position: absolute;
    left: 5px;
    color: var(--accent);
    font-weight: bold;
}

/* Skills Grid Styling */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.skill-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background-color: var(--accent-glow);
}

/* Projects Styling */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
}

.project-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 8px;
}

.ptag {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px 20px;
    }
    
    .nav-menu {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 20px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 40px 20px;
        width: 100%;
    }
}
