/* 
* Kenneth Chua - Personal Website
* CSS Styles
*/

/* ===== VARIABLES ===== */
:root {
    /* Colors - Light Theme (default) */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #4b5563;
    --accent-color: #f59e0b;
    --light-color: #f3f4f6;
    --dark-color: #111827;
    --gray-color: #9ca3af;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    
    /* Background Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Roboto', sans-serif;
    
    /* Spacing */
    --section-padding: 5rem 0;
    --container-padding: 0 1.5rem;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Colors - Dark Theme */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #9ca3af;
    --accent-color: #f59e0b;
    --light-color: #1f2937;
    --dark-color: #f3f4f6;
    --gray-color: #6b7280;
    --border-color: #374151;
    
    /* Background Colors - Dark Theme */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --bg-header: rgba(17, 24, 39, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea {
    font-family: var(--body-font);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.section-title {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--dark-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== HEADER & NAVIGATION ===== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-header);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--secondary-color);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s ease;
    color: var(--secondary-color);
    font-weight: 500;
    position: relative;
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.theme-toggle:hover::after {
    width: 100%;
}

.theme-toggle i {
    font-size: 1rem;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.theme-toggle #lightIcon {
    display: none;
}

[data-theme="dark"] .theme-toggle #darkIcon {
    display: none;
}

[data-theme="dark"] .theme-toggle #lightIcon {
    display: block;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: all 0.3s ease;
}

/* ===== HERO SECTION ===== */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-content h1 {
    font-family: var(--heading-font);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero-content h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===== ABOUT SECTION ===== */
#about {
    padding: var(--section-padding);
    background-color: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.about-details {
    margin-top: 2rem;
}

.detail {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.detail i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 20px;
}

/* ===== SKILLS SECTION ===== */
#skills {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 0.8rem;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skill-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.skill-item span {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* ===== PORTFOLIO SECTION ===== */
#portfolio {
    padding: var(--section-padding);
    background-color: var(--bg-primary);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--secondary-color);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.portfolio-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-10px);
}

.portfolio-img {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-img img {
    transform: scale(1.1);
}

.portfolio-info {
    padding: 1.5rem;
    background-color: var(--bg-card);
    transition: background-color 0.3s ease;
}

.portfolio-info h3 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.portfolio-info p {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-tech span {
    background-color: var(--bg-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.portfolio-links {
    display: flex;
    gap: 0.5rem;
}

/* ===== EXPERIENCE SECTION ===== */
#experience {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    padding: 1rem 2rem;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 1.5rem;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-date {
    position: absolute;
    top: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-item:nth-child(odd) .timeline-date {
    right: -150px;
}

.timeline-item:nth-child(even) .timeline-date {
    left: -150px;
}

.timeline-content {
    padding: 1.5rem;
    background-color: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content h3 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: var(--dark-color);
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timeline-content p {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.timeline-content ul {
    padding-left: 1.5rem;
}

.timeline-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

/* ===== CONTACT SECTION ===== */
#contact {
    padding: var(--section-padding);
    background-color: var(--bg-primary);
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.contact-info h3, .contact-form h3 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 20px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    color: var(--dark-color);
    background-color: var(--bg-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== FOOTER ===== */
#footer {
    background-color: var(--bg-secondary);
    color: var(--dark-color);
    padding: 4rem 0 2rem;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3.5rem;
    align-items: start;
}

.footer-logo a {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.footer-logo p {
    color: var(--secondary-color);
    margin-top: 0.5rem;
    transition: color 0.3s ease;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background-color: var(--primary-color);
    color: var(--bg-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    position: relative;
}

.footer-bottom p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

/* ===== RESPONSIVE DESIGN ===== */
@media screen and (max-width: 992px) {
    html {
        font-size: 15px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-dot {
        left: 21px !important;
    }
    
    .timeline-date {
        position: relative;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: -100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--bg-primary);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 15px var(--shadow-color);
        padding: 2rem 0;
        gap: 1.5rem;
    }
    
    .theme-toggle-container {
        margin: 0;
    }
    
    .theme-toggle {
        margin: 0 auto;
    }
    
    .nav-links.active {
        top: 70px;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .portfolio-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        margin-bottom: 2.5rem;
    }
    
    .footer-links ul {
        align-items: center;
        margin: 0.5rem 0;
    }
    
    .footer-social {
        justify-content: center;
        margin: 0.5rem 0;
    }
    
    #footer {
        padding: 3rem 0 1.5rem;
    }
}

@media screen and (max-width: 576px) {
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    #footer {
        padding: 2.5rem 0 1.2rem;
    }
    
    .footer-content {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

#darkLogo {
    display: none;
}

[data-theme="dark"] #lightLogo {
    display: none;
}

[data-theme="dark"] #darkLogo {
    display: inline;
}