/* ================================
   P-YSBC Main CSS
   Base styles, typography, colors, and layout
   ================================ */

/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #4fd1c7;
    --secondary-color: #2c5282;
    --accent-color: #ffd700;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --white: #ffffff;
    --light-bg: #f7fafc;
    --gradient-primary: linear-gradient(135deg, #4fd1c7, #38b2ac);
    --gradient-secondary: linear-gradient(135deg, #4fd1c7, #2c5282);
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 5rem;
    
    /* Layout */
    --container-max-width: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--secondary-color);
}

/* Layout Components */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.section-padding {
    padding: var(--spacing-4xl) 0;
}

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

.bg-light {
    background-color: var(--light-bg);
}

/* Section Headers */
.section-header {
    margin-bottom: var(--spacing-3xl);
}

.section-title {
    font-size: var(--font-size-4xl);
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    font-size: var(--font-size-xl);
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.section-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 209, 199, 0.3);
    color: var(--white);
}

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

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

/* Top Bar */
.top-bar {
    background: var(--secondary-color);
    color: var(--white);
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.contact-info {
    display: flex;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Header */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

/* Logo - Updated for Image Support */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: opacity var(--transition-base);
}

.logo:hover {
    opacity: 0.8;
}

/* Logo Image Container */
.logo-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-image img {
    height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform var(--transition-base);
}

.logo:hover .logo-image img {
    transform: scale(1.05);
}

/* Legacy Logo Icon (kept for backward compatibility) */
.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    margin-bottom: 0;
    line-height: 1.3;
}

.logo-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Navigation */
.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-xl);
    align-items: center;
    margin: 0;
}

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(79, 209, 199, 0.1);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(79, 209, 199, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: background-color var(--transition-base);
}

.hamburger:hover {
    background-color: rgba(79, 209, 199, 0.1);
}

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

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

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

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}
/* เพิ่มส่วนนี้ในไฟล์ main.css หลังจาก Navigation section */

/* ================================
   Dropdown Menu Styles
   ================================ */

/* Dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown content */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) 0;
    z-index: 1000;
    border: 1px solid rgba(79, 209, 199, 0.1);
    backdrop-filter: blur(10px);
    animation: dropdownFadeIn 0.2s ease-out;
}

/* Dropdown links */
.dropdown-content a {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    border-radius: 0;
}

.dropdown-content a:hover {
    background-color: rgba(79, 209, 199, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Dropdown arrow indicator */
.dropdown > .nav-link::after {
    content: "▼";
    font-size: 0.75em;
    margin-left: var(--spacing-xs);
    transition: transform var(--transition-base);
    display: inline-block;
}

.dropdown:hover > .nav-link::after {
    transform: rotate(180deg);
}

/* Animation for dropdown */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Mobile Responsive for Dropdown
   ================================ */

@media (max-width: 767.98px) {
    /* Mobile dropdown styles */
    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        background-color: rgba(79, 209, 199, 0.05);
        margin: var(--spacing-sm) 0 0 var(--spacing-lg);
        border: none;
        border-left: 3px solid var(--primary-color);
        border-radius: 0;
        padding: 0;
        animation: none;
    }
    
    .dropdown-content.show {
        display: block;
    }
    
    .dropdown-content a {
        padding: var(--spacing-md) var(--spacing-lg);
        color: var(--secondary-color);
        border-bottom: 1px solid rgba(79, 209, 199, 0.1);
    }
    
    .dropdown-content a:last-child {
        border-bottom: none;
    }
    
    .dropdown-content a:hover {
        background-color: rgba(79, 209, 199, 0.1);
        transform: none;
    }
    
    /* Mobile dropdown toggle */
    .dropdown > .nav-link {
        position: relative;
        cursor: pointer;
    }
    
    .dropdown > .nav-link::after {
        position: absolute;
        right: var(--spacing-md);
        top: 50%;
        transform: translateY(-50%);
    }
    
    .dropdown.active > .nav-link::after {
        transform: translateY(-50%) rotate(180deg);
    }
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(44, 82, 130, 0.8), rgba(44, 82, 130, 0.8)),
                url('../images/gallery/465788634_122107627358590776_6203678340374376049_n.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}
.hero-background-ourprojects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(44, 82, 130, 0.8), rgba(44, 82, 130, 0.8)),
                url('../images/gallery/business-brain-storm-meeting.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
}
.hero-content {
    text-align: left;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #adfdf7;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-2xl);
    opacity: 0.95;
    color: var(--white);
}

.hero-actions {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

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

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

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .logo-text h1 {
        font-size: var(--font-size-lg);
    }
    
    .logo-image img {
        height: 60px;
    }
    
    .nav-links {
        gap: var(--spacing-lg);
    }
}

@media (max-width: 767.98px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        padding: var(--spacing-lg);
        border-bottom: 1px solid rgba(79, 209, 199, 0.1);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .logo-image img {
        height: 50px;
    }
    
    .logo-text h1 {
        font-size: var(--font-size-base);
    }
    
    .logo-subtitle {
        font-size: var(--font-size-xs);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 479.98px) {
    .logo-image img {
        height: 40px;
    }
    
    .logo-text h1 {
        font-size: var(--font-size-sm);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .top-bar-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .logo-image img {
        border: 2px solid var(--primary-color);
        border-radius: var(--border-radius);
    }
}