/* ==============================================
   CSS RESET
   ============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==============================================
   HERO SECTION
   ============================================== */
.photos-hero {
    min-height: 40vh;
    background-image: url('../../images/aptech_photos.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 140px 30px 40px 30px;
    position: relative;
    overflow: hidden;
}

.photos-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.photos-hero-content {
    max-width: 800px;
    z-index: 2;
    position: relative;
}

.photos-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 25px 0;
    letter-spacing: 1px;
    line-height: 1.1;
    word-break: keep-all;
    word-wrap: break-word;
    color: white;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease 0.3s forwards;
}

.photos-hero p {
    font-family: 'Pretendard', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    opacity: 0;
    word-break: keep-all;
    word-wrap: break-word;
    color: white;
    transform: translateY(20px);
    animation: fadeInUp 1s ease 0.6s forwards;
}

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

/* ==============================================
   GALLERY SECTION
   ============================================== */
.photos-gallery-section {
    min-height: 100vh;
    background: #ffffff;
    padding: 0 0 60px 0;
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
}

/* ==============================================
   FILTER NAVIGATION
   ============================================== */
.filter-nav-wrapper {
    background: white;
    width: 100vw;
    margin: 0 calc(-50vw + 50%);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.filter-nav {
    background: white;
    border-radius: 0;
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    margin: 0 20px;
}

#filter-nav-container {
    display: flex;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
}

/* Filter Navigation Dividers */
#filter-nav-container::before,
#filter-nav-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1f3f4;
    z-index: 1;
}

#filter-nav-container::before {
    left: 0;
}

#filter-nav-container::after {
    right: 0;
}

.filter-nav-btn {
    flex: 1;
    padding: 20px 4px;
    border: none;
    background: white;
    color: #5a6268;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
    white-space: nowrap;
}

.filter-nav-btn:not(:last-child) {
    border-right: 1px solid #f1f3f4;
}

.filter-nav-btn:hover {
    color: #6B8B77;
    border-bottom-color: #6B8B77;
}

/* Active Button Styles */
.filter-nav-btn.active {
    font-weight: 600;
}

.filter-nav-btn.active[data-category="all"] {
    color: #FF8A4C;
    border-bottom-color: #FF8A4C;
}

.filter-nav-btn.active[data-category="urea-coating"] {
    color: #5A7A73;
    border-bottom-color: #5A7A73;
}

.filter-nav-btn.active[data-category="spray-foam"] {
    color: #FF8A4C;
    border-bottom-color: #FF8A4C;
}

.filter-nav-btn.active[data-category="injection"],
.filter-nav-btn.active[data-category="adhesive"],
.filter-nav-btn.active[data-category="momentive"],
.filter-nav-btn.active[data-category="raw-materials"] {
    color: #6c757d;
    border-bottom-color: #6c757d;
}

/* ==============================================
   GALLERY GRID
   ============================================== */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==============================================
   GALLERY ITEM
   ============================================== */
.gallery-item {
    transition: all 0.4s ease;
    cursor: default;
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.multi-image,
.gallery-item.before-after,
.gallery-item.single-image {
    cursor: pointer;
}

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

.gallery-item.multi-image:hover,
.gallery-item.before-after:hover,
.gallery-item.single-image:hover {
    transform: translateY(-8px);
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.gallery-item.empty-item {
    cursor: default;
}

/* Gallery Image */
.gallery-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.gallery-item:hover .gallery-image {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Gallery Image Split (Before/After) */
.gallery-image-split {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.gallery-item:hover .gallery-image-split {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.before-after-wrapper {
    display: flex;
    height: 100%;
}

.before-side,
.after-side {
    flex: 1;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Before/After Divider */
.before-after-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 60%;
    background: white;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.ba-label {
    position: absolute;
    bottom: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.before-side .ba-label {
    left: 10px;
}

.after-side .ba-label {
    right: 10px;
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    z-index: 3;
}

.category-badge.urea {
    background: #5A7A73;
}

.category-badge.spray {
    background: #FF8A4C;
}

.category-badge.injection,
.category-badge.adhesive,
.category-badge.raw,
.category-badge.momentive {
    background: #6c757d;
}

/* Image Count */
.image-count {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
}

/* Empty Gallery Item */
.gallery-image.empty {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon {
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
}

/* Gallery Info */
.gallery-info {
    padding: 12px 0;
    text-align: center;
}

.gallery-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin: 0 0 8px 0;
}

.gallery-info p {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.materials-used {
    font-size: 12px;
    font-weight: 500;
}

.materials-used.urea {
    color: #5A7A73;
}

.materials-used.spray {
    color: #FF8A4C;
}

.materials-used.injection,
.materials-used.adhesive,
.materials-used.raw,
.materials-used.momentive {
    color: #6c757d;
}

/* ==============================================
   IMAGE MODAL
   ============================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-header {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Noto Sans KR', sans-serif;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    position: relative;
    max-width: 800px;
    max-height: 600px;
}

.image-description {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Noto Sans KR', sans-serif;
    background: rgba(0,0,0,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.modal-image-wrapper {
    position: relative;
}

#modal-image {
    width: 750px;
    height: 500px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
}

.nav-btn {
    position: absolute;
    top: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-btn.prev {
    left: -60px;
    transform: translateY(-50%);
}

.nav-btn.next {
    right: -60px;
    transform: translateY(-50%);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Image Indicators */
.image-indicators {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #FF8A4C;
    transform: scale(1.2);
}

/* ==============================================
   FOOTER STYLES
   ============================================== */
footer {
    background: #2d3436;
    color: white;
    padding: 60px 0 40px 0;
    font-family: 'Noto Sans KR', sans-serif;
}

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

.footer-main {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #636e72;
}

.footer-logo-section {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.footer-logo-section img {
    height: 60px;
    margin-right: 25px;
    filter: brightness(1.2);
}

.footer-logo-section div {
    font-size: 14px;
    color: #b2bec3;
    line-height: 1.6;
    word-break: keep-all;
}

.footer-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    align-items: start;
}

.footer-info-grid article h4 {
    font-size: 16px;
    color: #f58f27;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.footer-info-grid article p {
    font-size: 14px;
    color: #b2bec3;
    line-height: 1.7;
    margin: 0;
    word-break: keep-all;
}

.contact-info {
    color: #ddd;
    margin-top: 8px;
    display: block;
}

.contact-info a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #f58f27;
}

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

.footer-copyright p {
    font-size: 12px;
    color: #636e72;
    margin: 0;
    word-break: keep-all;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */
@media (max-width: 1200px) {
    #gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    /* Hero Section */
    .photos-hero {
        min-height: 35vh;
        padding: 100px 20px 30px 20px;
    }
    
    .photos-hero h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .photos-hero-content p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Filter Navigation */
    .photos-gallery-section {
        padding-top: 0;
    }
    
    .filter-nav-wrapper {
        margin-top: 0;
        margin-bottom: 30px;
    }
    
    .filter-nav {
        margin: 0;
        padding: 0;
    }
    
    .filter-nav-btn {
        font-size: 10px;
        padding: 15px 4px;
        min-width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        text-overflow: visible;
        overflow: visible;
        width: auto;
    }
    
    #filter-nav-container {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 0;
        padding: 0;
    }
    
    #filter-nav-container::-webkit-scrollbar {
        display: none;
    }
    
    /* Gallery Grid */
    #gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }
    
    .gallery-container {
        padding: 0 15px;
    }
    
    /* Modal */
    #modal-image {
        width: 100%;
        height: auto;
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .nav-btn.prev,
    .nav-btn.next {
        left: 10px;
        top: 50%;
    }
    
    .nav-btn.next {
        left: auto;
        right: 10px;
    }
    
    /* Footer */
    footer {
        padding: 40px 0 30px 0;
    }
    
    .footer-container {
        padding: 0 20px;
    }
    
    .footer-main {
        margin-bottom: 30px;
    }
    
    .footer-logo-section img {
        height: 40px;
        margin-right: 20px;
    }
    
    .footer-logo-section div {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .footer-info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-info-grid article h4 {
        font-size: 14px;
    }
    
    .footer-info-grid article p {
        font-size: 12px;
        line-height: 1.6;
    }
    
    .footer-copyright p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #gallery-grid {
        max-width: 96vw;
    }
    
    .filter-nav-btn {
        font-size: 9px;
        padding: 16px 6px;
        min-width: 70px;
    }
    
    .gallery-container {
        padding: 0 10px;
    }
}
