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

:root {
    --primary-color: #1a237e;
    --secondary-color: #283593;
    --accent-color: #3949ab;
    --text-color: #333333;
    --light-color: #f5f5f5;
    --dark-color: #1a1a1a;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --container-width: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kantumruy Pro', 'Bayon', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bayon', 'Kantumruy Pro', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.highlight {
    color: var(--accent-color);
}

/* ===== LAYOUT & CONTAINERS ===== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.section-subtitle {
    color: #666;
    font-size: 1.2rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    min-height: 44px; /* Touch friendly */
}

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

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

.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;
}

/* ===== HEADER & NAVIGATION ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30%;
}

.main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--dark-color);
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.logo-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation */
.main-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 0;
    position: relative;
    transition: var(--transition);
}

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

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

/* Social Media */
.social-media {
    display: flex;
    gap: 15px;
}

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

.social-media a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    padding-top: 140px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eeff 100%);
    position: relative;
    overflow: hidden;
}

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

.hero-text {
    animation: fadeInLeft 1s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-top: 20px;
    margin-bottom: 20px;
}

.hero-subtitle {
    color: black;
    font-size: 1.5rem;
    line-height: 0.8;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #555;
}

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

.hero-image {
    animation: fadeInRight 1s ease-out;
}

.image-frame {
    width: 70%;
    margin: 0 auto;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.image-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.image-badge {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== ABOUT SECTION ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: start;
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.info-content p.p-3 {
    font-size: small;
    text-align: center;
    color: #666 ;
    line-height: 1.2;
}

.info-content h4 {
    font-size: medium;
    text-align: center;
    color: #666 ;
    line-height: 1.5;
    margin-top: 1rem;
    text-decoration: #1a1a1a underline;
}

.about-text h3 {
    text-align: center;
    color: blue ;
}

.about-text p.p-4 {

    color: #666 ;
}


.info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.info-content h3 {
    margin: 0 0 5px 0;
    color: var(--dark-color);
}

.info-content p {
    margin: 0;
    color: black;
    text-align: left;
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 40px;
    padding-left: 30px;
}

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-year {
    position: absolute;
    left: -100px;
    top: -5px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.timeline-content h4 {
    margin: 0 0 10px 0;
    color: var(--dark-color);
}

.timeline-content p {
    margin: 0;
    color: #666;
}

/* ===== GALLERY SECTION ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

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

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-text {
    color: white;
}

.gallery-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.gallery-text p {
    margin: 0;
    opacity: 0.9;
}

/* ===== CONTACT SECTION ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-details h3 {
    margin: 0 0 5px 0;
    color: var(--dark-color);
}

.contact-details a,
.contact-details p {
    margin: 0;
    color: #666;
    text-decoration: none;
    transition: var(--transition);
}

.contact-details a:hover {
    color: var(--primary-color);
}

/* Contact Form */
.contact-form {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f8f9fa;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== FOOTER ===== */
.main-footer {
    background: linear-gradient(135deg, var(--dark-color), #2a2a2a);
    color: white;
    padding: 60px 0 30px;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo .logo-icon {
    width: 50px;
    height: 50px;
    background: white;
    color: var(--primary-color);
}

.footer-text h3 {
    margin: 0 0 5px 0;
    color: white;
}

.footer-text p {
    margin: 0;
    opacity: 0.8;
}

.footer-links h4,
.footer-contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;              /* គម្លាតរវាងតំណនីមួយៗ */
}

.footer-contact h4 {
    color: white;
    margin-bottom: 10px;    /* បន្ថែមគម្លាតក្រោមចំណងជើង */
    font-size: 1.2rem;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;  /* ផ្លាស់ប្តូរពី var(--transition) */
    display: grid;
    grid-template-columns: auto 1fr;  /* icon និងអក្សរ */
    align-items: center;
    gap: 1rem;              /* កាត់បន្ថយពី 22px មក 12px វិញ */
    padding: 5px 7px;      /* បង្កើន padding ឲ្យងាយចុច */
    border-radius: 6px;     /* បន្ថែមជ្រុងមូល */
    background: rgba(255, 255, 255, 0.05);  /* ផ្ទៃខាងក្រោយថ្លាបន្តិច */
}

/* ស្ទីលសម្រាប់ icon */
.footer-contact a i,
.footer-contact a svg {
    width: 20px;            /* ទទឹងថេរ */
    text-align: center;
    font-size: 16px;
    color: #ffd54f;         /* ពណ៌មាសសម្រាប់ icon */
}

/* ស្ទីលពេល hover */
.footer-contact a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding-left: 18px;     /* រំកិលទៅស្តាំ 18px */
    border-left: 3px solid #ffd54f;  /* បន្ទាត់ខាងឆ្វេង */
}

.footer-contact a:hover i,
.footer-contact a:hover svg {
    color: white;
    transform: scale(1.1);  /* ពង្រីក icon បន្តិច */
}
.footer-links ul {
    list-style: none;
}

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

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

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.footer-contact i {
    width: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

.footer-bottom p {
    margin: 5px 0;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Tablet Styles */
@media (max-width: 992px) {
    .hero-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-section {
        padding-top: 120px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-year {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: 10px;
        display: inline-block;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 60px 0;
    }
    
    /* Header */
    .mobile-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        padding: 80px 20px 20px;
        overflow-y: auto;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav .nav-list {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
    
    .social-media {
        display: none;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* About Section */
    .about-info {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .contact-form {
        padding: 20px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
        flex-direction: column;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .header-content {
        padding: 15px 0;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .contact-form {
        padding: 15px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .social-media,
    .back-to-top,
    .hero-buttons,
    .contact-form {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    section {
        padding: 20pt 0;
        page-break-inside: avoid;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
}