/* UP TAIWAN - MODULE STYLES REVISED (v21 - Mobile Focus) */
#up-world-module {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ffffff;
    background-color: #0b0f19;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
}
#up-world-module * { box-sizing: border-box; }
#up-world-module img {
    max-width: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.protection-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999; background: transparent; display: none;
}
.up-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}
.text-center { text-align: center; }

/* HERO */
.up-hero-section { padding: 60px 0; background: radial-gradient(circle at top center, #121a2f 0%, #0b0f19 100%); }
.module-header { margin-bottom: 40px; }
.up-title {
    font-size: 3rem; font-weight: 800;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin: 0 0 15px 0; text-shadow: 0 10px 30px rgba(0,242,254,0.3);
}
.up-subtitle { font-size: 1.2rem; color: #b3c5ef; margin: 0; font-weight: 300; }

.map-wrapper {
    position: relative; width: 100%; aspect-ratio: 16/9;
    background: #080c14;
    border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05) inset;
    overflow: hidden;
}
#svg-container { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
#svg-container svg { width: 100%; height: 100%; will-change: transform; filter: drop-shadow(0 0 15px rgba(0,242,254,0.1)); }
#svg-container svg path {
    fill: #192233;
    stroke: #2d3b55; stroke-width: 0.6px;
    transition: fill 0.3s ease;
}

/* SALES NOTIFICATIONS */
#sales-notifications-layer {
    position: absolute; top:0; left:0; width:100%; height:100%; z-index:20; pointer-events:none;
}
.sales-popup {
    position: absolute;
    width: 50px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,242,254,0.6));
    will-change: transform, opacity;
}

/* SVG Lines Overlay */
#lines-svg { position: absolute; top:0; left:0; width:100%; height:100%; z-index:5; pointer-events:none; }
path.shipping-line { fill: none; stroke: #00f2fe; stroke-width: 2px; stroke-dasharray: 6 6; opacity: 0.5; filter: drop-shadow(0 0 5px #00f2fe); }

/* TECH CARDS SWIPER COMPATIBLE */
.up-tech-section { padding: 80px 0; background: linear-gradient(180deg, #0b0f19, #111726); border-top: 1px solid rgba(255,255,255,0.03); }
.up-section-title { text-align: center; font-size: 2.2rem; margin: 0 0 15px 0; color: #fff; font-weight: 700; text-shadow: 0 5px 15px rgba(0,0,0,0.5); }

.stack-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-swiper {
    width: 280px; 
    height: 380px;
    overflow: visible !important;
}

/* PREMIUM CARD BASE STYLES */
.tech-card {
    width: 100%;
    height: 100%;
    background: #171f30;
    border-radius: 15px;
    box-shadow: -5px 15px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,242,254,0.2) inset;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
}

.swiper-slide-active:hover, .tech-card.touch-active {
    filter: brightness(1.15);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 25px rgba(0, 242, 254, 0.2);
}

.swiper-slide-active:hover .card-desc h3, .tech-card.touch-active .card-desc h3 {
    color: #00f2fe;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.card-inner {
    display: flex; flex-direction: column; height: 100%; pointer-events: none;
}
.card-img-wrap {
    flex: 1; min-height: 200px; padding: 20px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
}
.card-img-wrap img { max-height: 160px; width: auto; object-fit: contain; filter: drop-shadow(0 15px 15px rgba(0,0,0,0.5)); transition: transform 0.5s; }
.tech-card:hover img { transform: scale(1.05); }

.card-desc {
    padding: 20px;
    background: #111726;
    min-height: 130px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.card-desc h3 { margin: 0 0 8px 0; font-size: 1.1rem; color: #00f2fe; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s; }
.card-desc p { margin: 0; font-size: 0.9rem; color: #9bb0db; line-height: 1.5; }

/* STAGES */
.up-stages-section { padding: 80px 0; background: #0c111c; border-top: 1px solid rgba(255,255,255,0.02); }
.stages-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.stage-item {
    background: #141c2b; border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px; padding: 40px 30px; text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.stage-item:hover { transform: translateY(-10px); background: #162032; border-color: rgba(0, 242, 254, 0.2); }
.stage-img { height: 160px; margin-bottom: 25px; display: flex; align-items: center; justify-content: center; }
.stage-img img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 15px 20px rgba(0,0,0,0.4)); transition: transform 0.4s; }
.stage-item:hover .stage-img img { transform: scale(1.05); }
.stage-content h3 { color: #00f2fe; font-size: 1.3rem; margin: 0 0 10px 0; font-weight: 600; }
.stage-content p { color: #8ba3cc; font-size: 0.95rem; margin: 0; line-height: 1.6; }

/* FOOTER */
.up-footer-section { padding: 50px 0; background: #06090e; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }

/* NEWS TICKER SECTION */
.up-news-ticker-section {
    background: #080c14;
    border-top: 1px solid rgba(0, 242, 254, 0.1);
    border-bottom: 1px solid rgba(0, 242, 254, 0.1);
    padding: 12px 0;
    overflow: hidden;
    position: relative;
    z-index: 100;
    width: 100%;
}
.up-news-ticker { width: 100%; overflow: hidden; white-space: nowrap; display: flex; }
.ticker-scroll-content { display: inline-block; white-space: nowrap; animation: scrollTicker 40s linear infinite; will-change: transform; }
.ticker-scroll-content:hover { animation-play-state: paused; }
.ticker-item { display: inline-block; color: #b3c5ef; font-size: 1.05rem; font-weight: 500; padding: 0 15px; letter-spacing: 0.5px; transition: color 0.3s ease; }
.ticker-item:hover { color: #00f2fe; }
.ticker-sep { display: inline-block; color: #00f2fe; font-size: 1.4rem; padding: 0 40px; vertical-align: middle; opacity: 0.6; }
@keyframes scrollTicker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* FOOTER ENHANCEMENTS */
.footer-tagline { color: #8ba3cc; margin-bottom: 25px; font-size: 0.95rem; }
.footer-contact-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.contact-item { display: flex; align-items: center; gap: 10px; color: #6a7b9e; font-size: 0.9rem; }
.contact-sep { color: rgba(255,255,255,0.1); font-weight: 200; }
.footer-social { display: flex !important; flex-direction: row !important; gap: 12px !important; margin-top: 15px !important; }
.social-link {
    width: 34px !important; height: 34px !important; display: flex !important; align-items: center !important; justify-content: center !important;
    background: #141c2b !important; border-radius: 4px !important; border: 1px solid rgba(0, 242, 254, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; color: #6a7b9e !important;
}
.social-link svg { width: 18px !important; height: 18px !important; fill: none !important; stroke: currentColor !important; stroke-width: 1.5 !important; }
.social-link:hover { background: #00f2fe !important; border-color: #00f2fe !important; color: #080c14 !important; transform: translateY(-3px) !important; box-shadow: 0 5px 15px rgba(0, 242, 254, 0.3) !important; }

/* MODAL CARD EXPERIENCES */
.card-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(6, 9, 14, 0.9); z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    backdrop-filter: blur(15px);
}
.card-modal-overlay.active { opacity: 1; pointer-events: auto; }
.card-modal-content {
    background: #141c2b; width: 90%; max-width: 450px; border-radius: 20px; padding: 40px; position: relative;
    transform: scale(0.8) translateY(50px); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 242, 254, 0.3); box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 40px rgba(0,242,254,0.1);
}
.card-modal-overlay.active .card-modal-content { transform: scale(1) translateY(0); }
.card-close-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; color: #6a7b9e; font-size: 2rem; cursor: pointer; transition: color 0.3s; }
.card-close-btn:hover { color: #f53b3b; }
.modal-body .card-img-wrap { min-height: 250px; background: transparent; padding: 0; margin-bottom: 20px; display: flex; justify-content: center; }
.modal-body .card-img-wrap img { max-height: 250px; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6)); }
.modal-body .card-desc { background: transparent; padding: 0; border: none; }
.modal-body .card-desc h3 { font-size: 1.8rem; text-align: center; color: #00f2fe; margin-bottom: 15px; }
.modal-body .card-desc p { font-size: 1.05rem; text-align: center; color: #9bb0db; line-height: 1.6; }

/* MOBILE RESPONSIVE NAVIGATION */
.mobile-toggle {
    display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
    cursor: pointer; color: #00f2fe; background: rgba(0,242,254,0.05); border-radius: 8px; border: 1px solid rgba(0,242,254,0.1);
}

.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(6,9,14,0.8); backdrop-filter: blur(5px);
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mobile-overlay.active { opacity: 1; pointer-events: auto; }

.mobile-drawer {
    position: fixed; top: 0; right: -300px; width: 300px; height: 100%;
    background: #0e1422; z-index: 10001; transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5); padding: 40px 30px;
    display: none; /* Default to hidden */
    flex-direction: column;
}
.mobile-drawer.active { right: 0; display: flex; }

.mobile-nav-links { display: flex; flex-direction: column; gap: 20px; }
.mobile-nav-links a { color: #b3c5ef; text-decoration: none; font-size: 1.1rem; font-weight: 600; transition: color 0.3s; }
.mobile-nav-links a:hover { color: #00f2fe; }
.mobile-nav-links a.quote-btn {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%); color: #0b0f19;
    padding: 12px; border-radius: 8px; text-align: center; margin-top: 10px;
}

.mobile-lang-switch { margin-top: auto; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 15px; }

@media (max-width: 991px) {
    .mobile-drawer { display: flex; } /* Only allow display on mobile */
    .hidden-mobile { display: none !important; }
    .mobile-toggle { display: flex; }
}

@media (max-width: 768px) {
    .stages-grid { grid-template-columns: 1fr; }
    .up-title { font-size: 2.2rem; }
    .footer-flex { flex-direction: column !important; text-align: center !important; }
    .footer-contact-grid { align-items: center !important; }
    .footer-social { justify-content: center !important; }
    .contact-item { flex-direction: column !important; gap: 5px !important; }
    .contact-sep { display: none !important; }
    .footer-logo img { max-width: 150px !important; margin-bottom: 20px !important; }
    .stack-wrapper { height: 400px; }
}

/* ============================================================
   V27 - DESKTOP GSAP FAN-OUT RESTORATION
   ============================================================ */
@media (min-width: 992px) {
    .tech-card {
        position: absolute !important;
        top: 0; left: 0;
        will-change: transform;
        transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
}

/* ============================================================
   V24 ADDENDUM - FIXED MOBILE HEADER CONTROLS
   ============================================================ */

/* Override old .mobile-toggle to work with the new grouped wrapper */
.mobile-header-controls {
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.lang-switch-mobile {
    display: flex;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.07);
    white-space: nowrap;
}
.lang-switch-mobile a {
    text-decoration: none;
    color: #9ca3af;
    transition: color 0.3s;
}
.lang-switch-mobile a.active,
.lang-switch-mobile a:hover { color: #00f2fe; }
.lang-switch-mobile span { color: rgba(255,255,255,0.15); }

@media (max-width: 991px) {
    .hidden-mobile { display: none !important; }
    .mobile-header-controls { display: flex; }
    /* Drawer is flex only on mobile - prevent display on desktop */
    .mobile-drawer { display: none; flex-direction: column; }
    .mobile-drawer.active { display: flex; }
}

@media (max-width: 480px) {
    .lang-switch-mobile { font-size: 11px; padding: 4px 8px; }
}
