/* Font Definitions */
@font-face {
    font-family: 'BabelStoneFlags';
    src: url('../fonts/BabelStoneFlags.subset.woff2') format('woff2');
    font-display: swap;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

/* Header Styles */
.header {
    background: transparent;
    border-bottom: 1px solid transparent;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(224, 224, 224, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Reduced spacing for closer language selector and join community */
}

/* Site Logo */
.site-logo {
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo:hover {
    transform: translateY(-2px);
}

.site-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: all 0.3s ease;
}

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

/* App Buttons */
.app-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.app-btn {
    background: transparent;
    border: none;
    color: #333;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent shrinking to avoid ellipsis */
}

.app-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.app-btn-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-icon-img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: contain;
}

.app-btn-text {
    font-size: 0.85rem;
    white-space: nowrap; /* Ensure no text wrapping or ellipsis */
    flex-shrink: 0; /* Prevent text from being compressed */
}

/* More Apps Dropdown */
.more-apps-dropdown {
    margin-left: 0.5rem;
    margin-right: 1rem; /* Add extra margin to create more space before Join Chat */
}

.more-apps-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #333;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.more-apps-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* More Apps button colorful icon */
.more-apps-icon {
    color: #999999;
    transition: all 0.3s ease;
}

.more-apps-btn:hover .more-apps-icon {
    color: #666666;
    transform: scale(1.1);
}

.more-apps-content {
    min-width: 220px;
}

.more-apps-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.more-app-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-app-icon-img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: contain;
}

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

/* Removed hover auto-expand - now only controlled by click */

.dropdown-btn {
    background: transparent;
    border: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.dropdown-btn i.fa-chevron-down {
    transition: transform 0.25s ease;
    display: inline-block;
}

/* show dropdown on focus-within for keyboard users */
.dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown:focus-within .dropdown-btn {
    background: rgba(0,0,0,0.03);
}

/* Rotate chevron when dropdown is opened (keyboard focus or programmatic .active) */
.dropdown:focus-within .dropdown-btn i.fa-chevron-down,
.dropdown.active .dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.social-link { display: flex; align-items: center; gap: 0.5rem; }
.social-link .social-name { margin-left: 0; }
.donation-text { margin-left: 0.4rem; }
.dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Join Community button icon warm outline style */
.dropdown-btn .far.fa-comments {
    color: #ff6b35; /* Warm orange color */
    transition: all 0.3s ease;
}

.dropdown-btn:hover .far.fa-comments {
    color: #e55a2b; /* Darker warm orange on hover */
    transform: scale(1.1);
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    z-index: 1000;
    margin-top: 0.5rem;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-content a {
    color: #333;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.dropdown-content a i {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown.active .dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Social platform icons colorful styles */
.dropdown-content a .fa-telegram-plane {
    color: #0088cc;
}

.dropdown-content a .fa-discord {
    color: #5865f2;
}

.dropdown-content a .fa-twitter {
    color: #1da1f2;
}

.dropdown-content a .fa-github {
    color: #333;
}

.dropdown-content a .fa-youtube {
    color: #ff0000;
}

.dropdown-content a .fa-instagram {
    color: #e4405f;
}

.dropdown-content a .fa-linkedin {
    color: #0077b5;
}

.dropdown-content a .fa-reddit {
    color: #ff4500;
}

.dropdown-content a .fa-whatsapp {
    color: #25d366;
}

.dropdown-content a .fa-wechat {
    color: #07c160;
}

.dropdown-content a .fa-qq {
    color: #1296db;
}

/* Language Dropdown Styles */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-dropdown-btn {
    background: transparent;
    border: none;
    color: #333;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.language-dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.current-lang-flag {
    font-family: 'BabelStoneFlags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 0.9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-align: center;
    font-feature-settings: "liga" on, "calt" on;
    vertical-align: middle;
}

.current-lang-name {
    font-weight: 500;
}

.language-dropdown-btn i.fa-chevron-down {
    transition: transform 0.25s ease;
    font-size: 0.75rem;
    opacity: 0.7;
}

.language-dropdown:focus-within .language-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown:focus-within .language-dropdown-btn {
    background: rgba(0,0,0,0.03);
}

.language-dropdown:focus-within .language-dropdown-btn i.fa-chevron-down,
.language-dropdown.active .language-dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.language-dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    z-index: 1000;
    margin-top: 0.5rem;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-link {
    color: #333;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.3s ease;
}

.language-link:hover {
    background-color: #f8f9fa;
}

.language-link:first-child {
    border-radius: 8px 8px 0 0;
}

.language-link:last-child {
    border-radius: 0 0 8px 8px;
}

.lang-flag {
    font-family: 'BabelStoneFlags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 0.9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-align: center;
    font-feature-settings: "liga" on, "calt" on;
    vertical-align: middle;
}

.lang-name {
    font-weight: 500;
}

.language-dropdown.active .language-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a .fa-qq {
    color: #12b7f5;
}

.dropdown-content a .fa-weibo {
    color: #e6162d;
}

.dropdown-content a:hover .fa-telegram-plane,
.dropdown-content a:hover .fa-discord,
.dropdown-content a:hover .fa-twitter,
.dropdown-content a:hover .fa-github,
.dropdown-content a:hover .fa-youtube,
.dropdown-content a:hover .fa-instagram,
.dropdown-content a:hover .fa-linkedin,
.dropdown-content a:hover .fa-reddit,
.dropdown-content a:hover .fa-whatsapp,
.dropdown-content a:hover .fa-wechat,
.dropdown-content a:hover .fa-qq,
.dropdown-content a:hover .fa-weibo {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Donation Button */
.donation-btn {
    background: linear-gradient(135deg, #ff5858 0%, #ffc8c8 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    text-decoration: none; /* remove underline for anchor styled as button */
}

.donation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.donation-btn:focus,
.donation-btn:active {
    text-decoration: none;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-logo {
    margin-bottom: 1rem;
}

.hero-logo img {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.hero-logo img:hover {
    transform: scale(1.02);
}

/* Elegant description text styles */
.hero-description {
    max-width: 550px;
    margin: 0 auto;
    padding: 1.5rem 0;
    position: relative;
}

.hero-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border-radius: 2px;
}

.hero-description p {
    font-size: 1.35rem;
    color: #555;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    background: linear-gradient(135deg, #333 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .hero-description p {
        background: none;
        -webkit-text-fill-color: initial;
        color: #555;
    }
}

/* Products Grid */
.products-section {
    margin-bottom: 4rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); /* Add subtle shadow in static state */
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #d0d0d0;
}

.product-logo {
    margin-bottom: 1rem;
}

.product-logo img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: contain;
}

.product-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.product-info p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: transparent;
    border-top: none;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    text-align: left;
}

.footer-left span {
    font-size: 0.9rem;
    color: #666;
}

.footer-right {
    text-align: right;
}

.footer-right a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-right a:hover {
    color: #333;
    transform: translateY(-1px);
}

/* Add subtle underline effect for email link */
.footer-right a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    transition: width 0.3s ease;
}

.footer-right a:hover::after {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-left {
        flex-wrap: wrap;
    }
    
    .app-buttons {
        flex-wrap: wrap;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .site-logo img {
        width: 28px;
        height: 28px;
    }
    
    .hero-logo img {
        width: 80px;
        height: 80px;
    }
    
    .hero-description {
        padding: 1rem 0;
    }
    
    .hero-description p {
        font-size: 1.25rem;
        font-weight: 500;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
        gap: 1.25rem;
        justify-content: center;
    }
    
    .product-card {
        padding: 1.25rem;
    }
    
    /* Footer responsive */
    .footer {
        padding: 2rem 0 1.5rem 0;
    }
    
    .footer-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .footer-left {
        order: 1;
        text-align: left;
    }
    
    .footer-left span,
    .footer-right a {
        font-size: 0.85rem;
    }
    
    .footer-right {
        order: 2;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .nav-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .nav-right {
        flex-wrap: wrap;
    }
    
    .site-logo img {
        width: 24px;
        height: 24px;
    }
    
    .hero-logo img {
        width: 70px;
        height: 70px;
    }
    
    .hero-description p {
        font-size: 1.15rem;
        font-weight: 500;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 250px));
        gap: 1rem;
        justify-content: center;
    }
    
    .product-logo img {
        width: 50px;
        height: 50px;
    }
    
    /* Small screen footer */
    .footer {
        padding: 1.5rem 0 1rem 0;
    }
    
    .footer-content {
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .footer-left {
        text-align: left;
    }
    
    .footer-right {
        text-align: left;
    }
    
    .footer-left span,
    .footer-right a {
        font-size: 0.8rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}

/* Smooth Transitions */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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