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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --light: #f8fafc;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --dark-gray: #334155;
    --success: #10b981;
    --transition: all 0.3s ease;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--secondary);
    background-color: #fff;
}
/* .container img{
    height: 50vh;
    width: 50% ;
    border-radius: 50%;
} */
.circle-img {
        width:400px;        /* ទំហំរូបភាព */
        height: 400px;       /* ទំហំរូបភាព */
        object-fit: cover;   /* កាត់រូបឲ្យសម */
        border-radius: 50%;  /* បម្លែងជារង្វង់ */
        border: 3px solid #142cb5; /* បន្ថែមស៊ុម (ស្រេចចិត្ត) */
        margin-left: 150px;
        margin-top: 45px;
    }
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

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

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

.btn-accent:hover {
    background-color: #d97706;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.2rem 0;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
}

.logo span {
    color: var(--primary);
}

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

.main-nav a {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

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

.main-nav a.active {
    color: var(--primary);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

/* Hero Section */
.hero {
    padding-top: 160px;
    padding-bottom: 100px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,0 L100,0 L100,100 Z" fill="%232563eb" opacity="0.05"/></svg>');
    background-size: cover;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    margin-bottom: 1rem;
    font-size: 3.2rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.highlight {
    display: inline-block;
    background-color: rgba(37, 99, 235, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--primary);
    font-weight: 600;
    margin: 1.5rem 0;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-image {
    text-align: center;
}

.code-animation {
    width: 100%;
    max-width: 400px;
    height: 300px;
    background-color: var(--secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.code-window {
    background-color: #1e293b;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.code-header {
    background-color: #334155;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot:nth-child(1) { background-color: #ef4444; }
.code-dot:nth-child(2) { background-color: #f59e0b; }
.code-dot:nth-child(3) { background-color: #10b981; }

.code-body {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-line {
    margin-bottom: 0.5rem;
}

.code-keyword {
    color: #60a5fa;
}

.code-function {
    color: #fbbf24;
}

.code-string {
    color: #34d399;
}

.code-comment {
    color: #94a3b8;
}

/* Section Common Styles */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
}

/* About Page Styles */
.about-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.bio-card {
    background-color: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

.skill-category {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.skill-category h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.8rem;
    position: relative;
}

.skill-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background-color: var(--light);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
}

.tool-item i {
    color: var(--primary);
}

/* Projects Page Styles */
.projects-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 2rem 0 3rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background-color: white;
    border: 2px solid var(--light-gray);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.project-card {
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 200px;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.project-content {
    padding: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-tag {
    background-color: var(--light);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Project Detail Page */
.project-detail-hero {
    padding-top: 160px;
    padding-bottom: 60px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.project-detail-content {
    max-width: 900px;
    margin: 0 auto;
}

.project-header {
    text-align: center;
    margin-bottom: 3rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.gallery-item {
    background-color: var(--light-gray);
    height: 250px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.info-card {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.tech-item {
    background-color: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
}

/* Experience Page */
.experience-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.timeline {
    max-width: 800px;
    margin: 3rem auto 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--light-gray);
}

.timeline-date {
    font-weight: 600;
    color: var(--primary);
}

.timeline-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.timeline-content h4 {
    color: var(--gray);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-list {
    list-style: none;
    margin-top: 1rem;
}

.timeline-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.timeline-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Education Page */
.education-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.education-content {
    /* display: grid; */
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.education-card {
    /* background-color: white; */
    background: #e9d5ffa1;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

.certificate-card {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.course-list {
    list-style: none;
    margin-top: 1rem;
}

.course-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.course-list li::before {
    content: '📘';
    position: absolute;
    left: 0;
}

/* Testimonials Page */
.testimonials-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    background-color: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    font-size: 5rem;
    color: var(--light-gray);
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: Georgia, serif;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Resume Page */
.resume-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.resume-content {
    max-width: 900px;
    margin: 3rem auto;
    background-color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.resume-section {
    margin-bottom: 3rem;
}

.resume-download {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--light);
    border-radius: var(--radius);
}

.resume-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

/* Contact Page */
.contact-hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

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

.social-link {
    width: 45px;
    height: 45px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

.contact-form {
    background-color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.map-placeholder {
    height: 300px;
    background-color: var(--light-gray);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    margin-top: 3rem;
}

.map-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 4rem 0 2rem;
}

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

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-links h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .hero-content,
    .about-content,
    .contact-content,
    .education-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
        z-index: 999;
    }
    
    .main-nav.active {
        transform: translateY(0);
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .resume-content {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero {
        padding-top: 140px;
        padding-bottom: 60px;
    }
    
    .hero-buttons,
    .project-links {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .contact-form,
    .bio-card,
    .education-card,
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }