/* ============================================
   Resume - SUNCODE
   Modern, Responsive Design
   ============================================ */

:root {
    /* Color Palette - Deep Ocean with Coral Accent */
    --color-bg: #0f1419;
    --color-bg-card: #1a2332;
    --color-bg-sidebar: #151d28;
    --color-accent: #ff6b4a;
    --color-accent-soft: rgba(255, 107, 74, 0.15);
    --color-accent-hover: #ff8a6f;
    --color-text: #e8eaed;
    --color-text-muted: #9aa0a6;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-gradient: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    
    /* Typography - use Kanit everywhere */
    --font-display: "Kanit", sans-serif;
    --font-body: "Kanit", sans-serif;
    
    /* Spacing */
    --sidebar-width: 340px;
    --section-gap: 2rem;
    --card-radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Overlay */
.page-loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255, 107, 74, 0.35) 0%, transparent 55%), var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: opacity 0.6s var(--transition), transform 0.6s var(--transition);
}

.page-loader-inner {
    text-align: center;
    padding: 2.5rem 3rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(21, 29, 40, 0.95), rgba(15, 20, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.page-loader-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b4a, #ff8a6f);
    overflow: hidden;
}

.page-loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.page-loader-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text);
}

.page-loader-subtitle {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-loader-dots {
    display: inline-flex;
    gap: 0.4rem;
    margin-top: 1.4rem;
}

.page-loader-dots span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--color-accent-soft);
    animation: loader-bounce 1.1s infinite ease-in-out;
}

.page-loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.page-loader-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loader-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-7px); opacity: 1; }
}

.page-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

/* Kanit base class from spec */
.kanit-regular {
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 107, 74, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 107, 74, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Layout
   ============================================ */

.resume-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   Scrollbar Styling (Sidebar + Main)
   ============================================ */

body,
.sidebar {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent-soft) transparent;
}

/* Chrome, Edge, Safari */
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-accent-soft);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    background: var(--color-bg-sidebar);
    padding: 2.5rem 1.5rem;
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.profile-card {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-image-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-accent);
    box-shadow: 0 8px 32px rgba(255, 107, 74, 0.2);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

.profile-title {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.sidebar-section {
    margin-bottom: 1.75rem;
}

.nav-menu {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--color-text);
    border-color: rgba(255, 107, 74, 0.35);
    background: var(--color-accent-soft);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--color-text);
    border-color: rgba(255, 107, 74, 0.5);
    background: var(--color-accent-soft);
}

.nav-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.info-list,
.contact-list {
    list-style: none;
}

.info-list li,
.contact-list li {
    font-size: 0.9rem;
    padding: 0.35rem 0;
    color: var(--color-text-muted);
}

.info-list .label,
.contact-list .label {
    display: inline-block;
    min-width: 70px;
    color: var(--color-text);
    font-weight: 500;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.contact-list .icon {
    flex-shrink: 0;
}

.contact-list a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.contact-list a:hover {
    color: var(--color-accent);
}

.job-interest {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.salary-range,
.location-pref {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.salary-range .label,
.location-pref .label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-accent);
    margin-bottom: 0.15rem;
}

.english-level {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding: 2.5rem 2.5rem 3rem;
}

.content-section {
    margin-bottom: var(--section-gap);
    animation: fadeInUp 0.6s ease-out forwards;
}

.content-section:nth-child(1) { animation-delay: 0.1s; }
.content-section:nth-child(2) { animation-delay: 0.15s; }
.content-section:nth-child(3) { animation-delay: 0.2s; }
.content-section:nth-child(4) { animation-delay: 0.25s; }
.content-section:nth-child(5) { animation-delay: 0.3s; }
.content-section:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    font-size: 1.1rem;
}

.section-text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* Skill Tags */
.skill-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags li {
    background: var(--color-bg-card);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.skill-tags li:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

/* Timeline Cards */
.timeline-card {
    background: var(--color-bg-card);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.timeline-card:hover {
    border-color: rgba(255, 107, 74, 0.3);
}

.timeline-card.highlight {
    border-left: 4px solid var(--color-accent);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-header h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

.year-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-radius: 6px;
    font-weight: 500;
}

.org-name {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.experience-duration {
    font-size: 0.85rem;
    color: var(--color-accent);
}

.timeline-details {
    list-style: none;
}

.timeline-details li {
    font-size: 0.9rem;
    padding: 0.25rem 0;
    color: var(--color-text-muted);
}

.timeline-details .label {
    display: inline-block;
    min-width: 100px;
    color: var(--color-text);
}

.subsection-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 1rem 0 0.5rem;
}

.achievement-list {
    list-style: none;
    padding-left: 0;
}

.achievement-list li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0.35rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.achievement-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-size: 0.8rem;
}

/* Tech Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tech-tags span {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-radius: 6px;
    font-weight: 500;
}

/* ============================================
   Footer
   ============================================ */

.resume-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

/* ============================================
   Portfolio Pages
   ============================================ */

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.portfolio-card {
    grid-column: span 6;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: all var(--transition);
}

.portfolio-card:hover {
    border-color: rgba(255, 107, 74, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.portfolio-card-thumb {
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, var(--color-bg-sidebar) 0%, var(--color-bg) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
}

.portfolio-placeholder {
    font-size: 3rem;
    opacity: 0.6;
}

.portfolio-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-card-body {
    padding: 1.25rem;
}

.portfolio-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.portfolio-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-top: 0.35rem;
}

.portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.portfolio-pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.action-row {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition);
}

.btn:hover {
    border-color: rgba(255, 107, 74, 0.35);
    background: var(--color-accent-soft);
}

.btn.primary {
    border-color: rgba(255, 107, 74, 0.5);
    background: var(--color-accent-soft);
}

@media (max-width: 900px) {
    .portfolio-card { grid-column: span 12; }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .resume-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        height: auto;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 2rem;
        align-items: start;
        padding: 2rem;
    }
    
    .profile-card {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 2rem;
        text-align: left;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .profile-image-wrapper {
        margin: 0;
        width: 100px;
        height: 100px;
    }
    
    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-image-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .content-title {
        font-size: 1.1rem;
    }
    
    .timeline-header {
        flex-direction: column;
    }
    
    .year-badge {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .profile-name {
        font-size: 1.25rem;
    }
    
    .skill-tags li,
    .tech-tags span {
        font-size: 0.85rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    body::before {
        display: none;
    }
    
    body {
        background: white;
        color: #333;
    }
    
    .resume-container {
        max-width: 100%;
    }
    
    .sidebar {
        background: #f5f5f5;
        border-right: 1px solid #ddd;
        position: static;
        height: auto;
    }
    
    .profile-image-wrapper {
        border-color: #333;
    }
    
    .section-title {
        color: #333;
    }
    
    .content-section {
        break-inside: avoid;
    }
    
    .timeline-card {
        background: white;
        border: 1px solid #ddd;
    }
    
    .resume-footer {
        border-top-color: #ddd;
    }
    
    :root {
        --color-text: #333;
        --color-text-muted: #555;
        --color-accent: #c0392b;
        --color-bg-card: #fafafa;
        --color-bg-sidebar: #f5f5f5;
    }
}
