/* ===== RESET & VARIABLES ===== */
:root {
    --primary-gold: #ffcc33;
    --primary-gold-light: #ffdb6b;
    --primary-gold-dark: #e6b82b;
    --overlay-dark: rgba(0, 0, 0, 0.6);
    --overlay-light: rgba(255, 255, 255, 0.1);
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    background: url('100909.jpg') no-repeat center center/cover;
    position: relative;
}

.overlay {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.logo {
    width: clamp(150px, 25vw, 300px);
    height: auto;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 30px;
    transition: var(--transition);
}

.nav-link:hover {
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Content */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 5%;
    text-align: center;
}

.hero-title {
    font-family: 'Kanit', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 4px 15px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: 3rem;
    color: rgba(255,255,255,0.9);
    animation: fadeInUp 1s ease 0.2s both;
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 1s ease 0.4s both;
}

.member-card {
    text-decoration: none;
    color: var(--text-light);
    background: var(--overlay-light);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.member-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-hover);
}

.card-bg {
    height: 280px;
    background-size: cover;
    background-position: center;
    transition: var(--transition);
}

.member-card:hover .card-bg {
    transform: scale(1.1);
}

.member-name {
    display: block;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Member Sections */
.member-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem 5%;
    position: relative;
    overflow: hidden;
}

.member-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(10px);
    transform: scale(1.1);
    z-index: -1;
}

/* Theme backgrounds */
.theme-rung {
    background: linear-gradient(135deg,#27ae60 0%,#2980b9 100%);
}

.theme-sun {
    background: linear-gradient(135deg,#444443 0%,#000000 100% );
}

.theme-manao {
    background: linear-gradient(135deg,#985495 0%,#8e2191 100%);
}

.theme-fourth {
    background: linear-gradient(135deg,#2c3e50 0%,#3498db 100%);
}

.section-container {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Member Info */
.member-info {
    flex: 1;
    padding: 2rem;
}

.member-tag {
    background: var(--primary-gold);
    color: var(--text-dark);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border-radius: 30px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.member-title {
    font-family: 'Kanit', sans-serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 3px 3px 20px rgba(0,0,0,0.4);
    line-height: 1.2;
}

.info-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-gold);
    margin-bottom: 2rem;
    max-width: 500px;
}

.info-row {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    width: 120px;
    color: var(--primary-gold);
}

.info-value {
    flex: 1;
}

.info-value.grade {
    font-weight: 600;
    color: var(--primary-gold);
}

/* Member Navigation */
.member-nav {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.nav-thumb {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent;
    transition: var(--transition);
}

.nav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-thumb.active,
.nav-thumb:hover {
    border-color: var(--primary-gold);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255,204,51,0.5);
}

/* Back Button */
.back-btn {
    color: var(--text-light);
    text-decoration: none;
    border: 2px solid var(--text-light);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.back-btn:hover {
    background: var(--text-light);
    color: var(--text-dark);
    border-color: var(--text-light);
}

/* Member Image */
.member-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: float 6s ease-in-out infinite;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-gold);
    color: var(--text-dark);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 100;
    opacity: 0.9;
}

.scroll-top:hover {
    background: var(--primary-gold-light);
    transform: scale(1.1) translateY(-5px);
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .member-grid {
        gap: 1rem;
    }

    .card-bg {
        height: 220px;
    }

    .section-container {
        gap: 2rem;
    }

    .member-title {
        font-size: clamp(2.5rem, 5vw, 4rem);
    }

    .info-card {
        padding: 1.5rem;
    }
}

/* Mobile (up to 768px) */
@media screen and (max-width: 768px) {
    /* Hero Section */
    header {
        padding: 1rem;
    }

    .logo {
        width: 140px;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Member Grid - Vertical on Mobile */
    .member-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
    }

    .card-bg {
        height: 200px;
    }

    .member-name {
        padding: 0.8rem;
        font-size: 1rem;
    }

    /* Member Sections - Stack Vertically */
    .member-section {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .section-container {
        flex-direction: column;
        gap: 2rem;
    }

    .member-info {
        padding: 1rem;
        order: 2;
        width: 100%;
    }

    .member-image {
        order: 1;
        width: 100%;
    }

    .profile-image {
        max-height: 50vh;
        margin: 0 auto;
    }

    .member-tag {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .member-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .info-card {
        max-width: 100%;
        padding: 1.2rem;
        margin: 1rem 0;
    }

    .info-row {
        flex-direction: column;
        gap: 0.3rem;
        margin-bottom: 0.8rem;
    }

    .info-label {
        width: 100%;
        font-size: 0.9rem;
    }

    .info-value {
        font-size: 1rem;
        padding-left: 0.5rem;
    }

    /* Navigation */
    .member-nav {
        justify-content: center;
        margin: 1.5rem 0;
    }

    .nav-thumb {
        width: 55px;
        height: 55px;
    }

    .back-btn {
        display: block;
        text-align: center;
        margin-top: 1rem;
    }

    /* Scroll Button */
    .scroll-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* Small Mobile (up to 480px) */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .member-title {
        font-size: 2rem;
    }

    .card-bg {
        height: 180px;
    }

    .member-nav {
        gap: 0.5rem;
    }

    .nav-thumb {
        width: 45px;
        height: 45px;
    }

    .profile-image {
        max-height: 40vh;
    }

    .info-card {
        padding: 1rem;
    }

    .back-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Landscape Mode */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
    }

    .hero-content {
        padding: 1rem 5%;
    }

    .member-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }

    .card-bg {
        height: 150px;
    }

    .member-section {
        min-height: auto;
        padding: 2rem 1rem;
    }

    .profile-image {
        max-height: 60vh;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}




