/* ============================================
   VARIABLES & GLOBAL STYLES
   ============================================ */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    /* background-color: var(--bg-white); */
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #1f2937;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    /* background-color: black; */

}

.nav-link {
    /* color: var(--text-dark); */
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    color: white;
}


.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
    padding: 100px 20px;
    max-width: 1500px;
    margin: 0 auto;
    min-height: 600px;
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    
}

.hero-content h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    /* -webkit-text-fill-color: transparent; */
    background-clip: text;
    /* color: white; */
    color: white;
}
.hero-content{
    margin-left: 100px;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 600;
    color: white;
}



.hero-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  margin-bottom: 2rem;
}



.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;

}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: inline-block;
   
}

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

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

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

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

 .circle-img {
        width:400px;        /* ទំហំរូបភាព */
        height: 400px;       /* ទំហំរូបភាព */
        object-fit: cover;   /* កាត់រូបឲ្យសម */
        border-radius: 50%;  /* បម្លែងជារង្វង់ */
        border: 3px solid #ddd; /* បន្ថែមស៊ុម (ស្រេចចិត្ត) */
        margin-left: 150px;
        margin-top: 45px;
    }

.circle-img:hover{
    transform: translateY(-24px);

}

*/
.square {
  width: 150px;      /* ទំហំការ៉េ */
  height: 150px;
  overflow: hidden;  /* កាត់ត */
  border-radius: 0;  /* 0 = 4 ជ្រុងតូចៗតែម្តង */
}

.square img {
  width: 74%;
  height: 88%;
  object-fit: cover; /* កាត់អោយសមការ៉េ */
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}
/* Smooth transition for project card details */
.project-card p {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ============================================
   FEATURED PROJECTS
   ============================================ */

.featured-projects {
    padding: 80px 20px;
    background-color: var(--bg-light);
}

.featured-projects h2,
.skills h2,
.experience h2,
.education h2,
.contact-section h2 {
    font-size: 40px;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

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

.project-card:hover {
    transform: translateY(-24px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.project-card h3 {
    padding: 20px 20px 10px;
    font-size: 20px;
    color: var(--text-dark);
}

.project-card p {
    padding: 0 20px;
    color: var(--text-light);
    font-size: 14px;
}

.project-link {
    display: inline-block;
    padding: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

/* ============================================
   SKILLS SECTION
   ============================================ */

.skills {
    padding: 80px 20px;
}

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

.skill-item {
    background-color: var(--bg-light);
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    /* transition: var(--transition); */
    border: 2px solid transparent;
}

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

.skill-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.skill-item h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.skill-item p {
    color: var(--text-light);
    font-size: 14px;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.cta h2 {
    font-size: 40px;
    margin-bottom: 20px;
    color: white;
}

.cta p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.cta .btn-primary:hover {
    background-color: var(--bg-light);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 60px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

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

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    /* background-color: var(--border-color); */
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-section {
    /* background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); */
    padding: 80px 20px;
    max-width: 1600px;
    margin: 0 auto;
    color: white;
    /* background-color: var(--border-color); */
    background-color: rgb(230, 121, 230);
    
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-circle {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
}

.about-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-align: left;
    color: white;
}

.about-content p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 16px;
    color: white;

}

.about-content h3 {
    font-size: 20px;
    margin: 30px 0 15px;
    color: var(--text-dark);
    color: white;

}

.approach-list {
    list-style: none;
    color: white;

}

.approach-list li {
    padding: 10px 0;
    color: var(--text-light);
    font-size: 16px;
    color: white;

}

/* ============================================
   EXPERIENCE SECTION
   ============================================ */

.experience {
    padding: 80px 20px;
    background-color: var(--bg-light);
    max-width: 1200px;
    margin: 0 auto;
}

.experience h2 {
    text-align: left;
    margin-bottom: 50px;
}

.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

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

.timeline-marker {
    position: absolute;
    left: -50px;
    top: 0;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.timeline-content h3 {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.timeline-company {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.8;
}

/* ============================================
   EDUCATION SECTION
   ============================================ */

.education {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.education h2 {
    text-align: left;
    margin-bottom: 50px;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.education-card {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.education-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.education-school {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.education-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* ============================================
   PROJECTS PAGE
   ============================================ */

.filter-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background-color: white;
    color: var(--text-dark);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

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

.projects-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.projects-grid-large {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.project-card-large {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

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

.project-card-large:nth-child(even) {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.project-card-large:nth-child(even) .project-info {
    direction: ltr;
}

.project-image-large {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.project-info {
    padding: 40px;
}

.project-info h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 16px;
}

.tag {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

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

.project-btn.secondary {
    border-color: var(--text-light);
    color: var(--text-light);
}

.project-btn.secondary:hover {
    background-color: var(--text-light);
    color: white;
    border-color: var(--text-light);
}

/* ============================================
   CONTACT PAGE
   ============================================ */

.contact-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h2 {
    text-align: left;
    margin-bottom: 40px;
}

.info-item {
    margin-bottom: 40px;
}

.info-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.info-item p {
    color: var(--text-light);
    font-size: 16px;
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.social-links-large {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link-large {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--bg-light);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 600;
}

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

.contact-form-wrapper h2 {
    text-align: left;
    margin-bottom: 30px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
}

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

.contact-form button {
    margin-top: 10px;
}

.form-message {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
    display: none;
}

.form-message.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.form-message.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        gap: 0;
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 60px 20px;
        min-height: auto;
        gap: 40px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .profile-circle {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }

    .featured-projects h2,
    .skills h2,
    .experience h2,
    .education h2,
    .contact-section h2 {
        font-size: 28px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-circle {
        width: 200px;
        height: 200px;
    }

    .about-content h2 {
        font-size: 28px;
    }

    .page-header h1 {
        font-size: 32px;
    }

    .page-header p {
        font-size: 16px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .project-card-large {
        grid-template-columns: 1fr;
    }

    .project-card-large:nth-child(even) {
        direction: ltr;
    }

    .project-image-large {
        height: 250px;
    }

    .project-info {
        padding: 30px;
    }

    .project-info h3 {
        font-size: 22px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cta h2 {
        font-size: 28px;
    }

    .cta p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        height: 60px;
    }

    .nav-logo a {
        font-size: 20px;
    }

    .hero {
        padding: 40px 15px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-description {
        font-size: 14px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .profile-circle {
        width: 150px;
        height: 150px;
    }

    .featured-projects h2,
    .skills h2,
    .experience h2,
    .education h2,
    .contact-section h2 {
        font-size: 22px;
        margin-bottom: 30px;
    }

    .featured-projects,
    .skills,
    .experience,
    .education,
    .projects-section,
    .contact-section {
        padding: 40px 15px;
    }

    .page-header {
        padding: 50px 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

    .about-circle {
        width: 150px;
        height: 150px;
    }

    .about-content h2 {
        font-size: 22px;
    }

    .about-content p,
    .about-content h3,
    .approach-list li {
        font-size: 14px;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline-marker {
        left: -45px;
    }

    .timeline-content h3 {
        font-size: 16px;
    }

    .education-card {
        padding: 20px;
    }

    .education-card h3 {
        font-size: 16px;
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .project-info {
        padding: 20px;
    }

    .project-info h3 {
        font-size: 18px;
    }

    .project-info p {
        font-size: 14px;
    }

    .project-links {
        flex-direction: column;
    }

    .project-btn {
        width: 100%;
        text-align: center;
    }

    .contact-info h2,
    .contact-form-wrapper h2 {
        font-size: 22px;
    }

    .info-item h3 {
        font-size: 16px;
    }

    .info-item p {
        font-size: 14px;
    }

    .social-links-large {
        flex-direction: column;
    }

    .social-link-large {
        width: 100%;
        text-align: center;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }

    .cta h2 {
        font-size: 22px;
    }

    .cta p {
        font-size: 14px;
    }

    .footer-section h3 {
        font-size: 16px;
    }

    .footer-section p,
    .footer-section a {
        font-size: 12px;
    }

    .social-links {
        justify-content: center;
    }
}
