/* Global styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* System Font Stack for better performance and Chinese character support */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #334155;
    /* Slate 700 */
    background-color: #f8fafc;
    /* Slate 50 */
    line-height: 1.6;
}

main {
    flex: 1;
}

/* Typography optimization */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1e293b;
    /* Slate 800 */
    font-weight: 700;
}

.hero-section {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    /* Light blue gradient */
    border-bottom: 1px solid #e2e8f0;
}

.display-4 {
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.7;
    color: #475569;
    /* Slate 600 */
}

/* Navbar polish */
.navbar {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: #0f172a !important;
    /* Slate 900 */
}

.nav-link {
    color: #475569 !important;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #2563eb !important;
    /* Blue 600 */
}

/* Language Switcher */
.language-selector {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.language-selector .lang-link {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0 5px;
    transition: color 0.2s;
}

.language-selector .lang-link:hover,
.language-selector .lang-link.active {
    color: #0d6efd;
    font-weight: 700;
}

.language-selector .sep {
    color: #dee2e6;
    margin: 0 2px;
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .language-selector {
        margin-left: auto;
        /* Push to the right on mobile */
        margin-right: 15px;
        /* Spacing from toggler */
    }
}

/* Desktop adjustments */
@media (min-width: 992px) {
    .language-selector {
        order: 3;
        /* Ensure it stays on the right if needed, or place manually */
        margin-left: 20px;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 20px;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    /* iOS-like superellipse approximation */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.card-title {
    color: #fff;
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.app-subtitle {
    color: #94a3b8;
    /* Slate 400 */
    font-size: 0.85rem;
    font-weight: 500;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-text {
    color: #475569;
    /* Slate 600 */
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Buttons */
.btn-primary {
    background: #e2e8f0;
    /* Slate 200 */
    color: #0f172a;
    /* Slate 900 */
    border: none;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    border-radius: 20px;
    width: 100%;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background: #cbd5e1;
    /* Slate 300 */
    color: #0f172a;
    transform: translateY(-1px);
}


/* Print styles for better SEO */
@media print {
    .navbar {
        display: none;
    }

    .product-image {
        max-width: 500px;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .feature-card {
        margin-bottom: 1rem;
    }

    .contact-info {
        padding: 1.5rem;
    }
}

/* Product Page Hero */
.product-hero {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 4rem 0;
    margin-bottom: 3rem;
    text-align: center;
}

.product-hero h1 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.product-hero .lead {
    color: #cbd5e1;
    /* Slate 300 */
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns on desktop */
    gap: 20px;
    margin-bottom: 4rem;
    padding: 10px 0;
}

.screenshot-item {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    aspect-ratio: 9/19.5;
    background: #000;
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.screenshot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive Carousel */
@media (max-width: 768px) {
    .screenshot-gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .screenshot-gallery::-webkit-scrollbar {
        display: none;
    }

    .screenshot-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
        aspect-ratio: 9/19.5;
        max-width: 300px;
        margin-right: 0;
    }
}