/**
 * New Weng Seng - Projects Page Styles
 * 工程案例頁面樣式
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    line-height: 1.5;
    opacity: 0;
    animation: fadeInPage 0.8s ease-out forwards;
}

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

/* Header */
header {
    background: rgba(255,255,255,0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    border-bottom: 1px solid #ddd;
}

.header-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 41px;
    width: 100px;
    object-fit: contain;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

#main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

#main-nav a {
    color: #1d1d1f;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

#main-nav a.login-link {
    color: #b87333;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 3px;
    background: #333;
    border-radius: 2px;
}

/* Hero Section */
.projects-hero {
    background: linear-gradient(135deg, rgba(184,149,106,0.4) 0%, rgba(154,123,90,0.4) 100%), url('images/projects/casino-hero.png');
    background-size: cover;
    background-position: center;
    padding: 40px 0;
    color: #fff;
    transition: background-image 0.5s ease-in-out;
}

.projects-hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.category-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.1;
}

/* Category Navigation */
.category-nav {
    background: #f8f8f8;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.category-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 40px;
    overflow-x: auto;
    align-items: center;
}

.category-nav-item {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    padding: 10px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.category-nav-item:hover {
    color: #9A7B5A;
}

.category-nav-item.active {
    color: #9A7B5A;
    border-bottom-color: #9A7B5A;
}

.view-toggle {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.view-btn {
    padding: 12px 24px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}

.view-btn.active {
    background: #fff;
    color: #9A7B5A;
    border-color: #fff;
}

/* Projects Section */
.projects-section {
    padding: 80px 0;
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Grid View */
.projects-grid {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.projects-grid.active {
    display: grid;
}

.project-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.project-image {
    width: 100%;
    height: 250px;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
}

.project-info {
    padding: 24px;
}

.project-category {
    font-size: 12px;
    color: #9A7B5A;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.project-location {
    font-size: 14px;
    color: #666;
}

/* List View */
.projects-list {
    display: none;
}

.projects-list.active {
    display: block;
}

.project-list-item {
    display: flex;
    gap: 30px;
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.3s;
}

.project-list-item:hover {
    background: #f8f8f8;
}

.project-list-image {
    width: 300px;
    height: 200px;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border-radius: 8px;
}

.project-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-list-item .project-category {
    margin-bottom: 12px;
}

.project-list-item .project-title {
    font-size: 24px;
    margin-bottom: 16px;
}

.project-list-item .project-location {
    font-size: 16px;
}

/* Section Container */
.section-container {
    display: none;
}

.section-container.active {
    display: block;
}

/* Footer */
footer {
    background: #f5f5f7;
    padding: 40px 0 20px;
    font-size: 12px;
    color: #86868b;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-section h3 {
    font-size: 13px;
    color: #1d1d1f;
    margin-bottom: 12px;
}

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

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

.footer-section a {
    color: #86868b;
    text-decoration: none;
}

.footer-section a:hover {
    color: #9A7B5A;
}

.footer-bottom {
    max-width: 1000px;
    margin: 30px auto 0;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
}

/* 與 index 頁 footer 一致的輔助樣式 */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

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

.fade-in-delay-4 {
    animation-delay: 0.4s;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: #fff;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    margin: auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s ease-out;
    transition: width 0.25s ease;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-header {
    background: linear-gradient(135deg, #B89566 0%, #9A7B5A 100%);
    color: #fff;
    padding: 14px 28px;
}

.modal-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0;
}

.modal-location {
    font-size: 16px;
    opacity: 0.9;
}

.modal-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.modal-gallery {
    margin-bottom: 30px;
}

.modal-main-image {
    width: 100%;
    height: 400px;
    background-color: #111;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-thumbnail {
    width: 100px;
    height: 70px;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
    flex-shrink: 0;
}

.modal-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.modal-thumbnail.active {
    opacity: 1;
    border: 2px solid #9A7B5A;
}

.modal-description {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-detail-item {
    font-size: 14px;
}

.modal-detail-label {
    color: #9A7B5A;
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-detail-value {
    color: #333;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
    
    #main-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff;
        z-index: 999;
        overflow-y: auto;
        display: none;
    }
    
    #main-nav.open {
        display: block;
    }
    
    #main-nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    #main-nav li {
        border-bottom: 1px solid #eee;
        display: block;
    }
    
    #main-nav a {
        display: block;
        padding: 20px 0;
        font-size: 20px;
    }
    
    .projects-hero-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }
    
    .category-title {
        font-size: 21px;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: flex-start;
    }
    
    .projects-hero {
        padding: 30px 0;
    }
    
    .category-nav-container {
        padding: 0 20px;
        gap: 20px;
    }
    
    .category-nav-item {
        font-size: 14px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .project-list-item {
        flex-direction: column;
        gap: 20px;
    }
    
    .project-list-image {
        width: 100%;
        height: 200px;
    }
    
    .projects-container {
        padding: 0 20px;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-main-image {
        height: 250px;
    }
    
    .modal-thumbnail {
        width: 80px;
        height: 60px;
    }
}

@media screen and (min-width: 769px) {
    .mobile-menu-btn {
        display