/* Root Variables */
:root {
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3; /* Sharp tech blue */
    --nav-height: 75px;
    --container-width: 1200px;
    --transition-speed: 0.3s;
    --nav-bg: rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

main {
    padding-top: var(--nav-height);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Bar */
header {
    height: var(--nav-height);
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header .container {
    height: 100%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo,
.logo a,
.nav-links,
.nav-links a,
.lang-selector {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links {
    gap: 30px;
}

.logo img {
    height: 45px;
    width: auto;
}

.lang-selector {
    position: relative;
    cursor: pointer;
}

.nav-links a,
.lang-selector span {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nav-links a:hover,
.lang-selector:hover span {
    color: var(--accent-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    display: none;
    min-width: 140px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

.lang-selector:hover .lang-dropdown {
    display: block;
}

.lang-dropdown li {
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.lang-dropdown li:hover {
    background: #f5f5f7;
    color: var(--accent-color);
}

/* Portfolio Grid */
section {
    padding: 80px 0;
}

h2.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    letter-spacing: -0.02em;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.app-card {
    background: var(--card-bg);
    border-radius: 28px;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.app-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.app-icon-wrap {
    padding: 50px 50px 20px 50px;
    text-align: center;
    background: transparent; /* Ensure no background behind the icon */
}

.app-icon {
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 24px;
    /* Only a subtle shadow to give depth, no solid background */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-info {
    padding: 0 20px 40px 20px;
    text-align: center;
}

.app-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.learn-more-btn {
    display: inline-block;
    padding: 8px 22px;
    background: #f5f5f7;
    border-radius: 20px;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.app-card.coming-soon-card {
    background: transparent;
    border: 2px dashed rgba(0, 0, 0, 0.05);
    box-shadow: none;
    cursor: default;
}

.app-card.coming-soon-card:hover {
    transform: none;
    box-shadow: none;
}

.coming-soon-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f5f5f7 0%, #e5e5e7 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* App Detail Page Specific */
.detail-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 80px;
    padding-top: 120px;
    padding-bottom: 120px;
    min-height: 700px;
}

.detail-info {
    flex: 1.2;
}

.detail-visuals {
    flex: 0.8;
    display: flex;
    justify-content: center;
}

.slideshow-container {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15), 0 0 0 10px #f5f5f7; /* Light Device Frame */
}

/* Device Specific Slideshow Layouts */
.slideshow-container.portrait,
.slideshow-container.iphone-portrait {
    width: 320px;
    aspect-ratio: 460 / 996;
    height: auto;
    border-radius: 48px;
}

.slideshow-container.iphone-landscape {
    width: 650px;
    max-width: 100%;
    aspect-ratio: 996 / 460;
    height: auto;
    border-radius: 36px;
}

.slideshow-container.ipad-portrait {
    width: 480px;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 24px;
}

.slideshow-container.ipad-landscape {
    width: 700px;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    border-radius: 20px;
}

.slideshow-container.tv-landscape,
.slideshow-container.mac-landscape {
    width: 850px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 12px;
}

.slideshow-container.mac-landscape {
    aspect-ratio: 16 / 10;
}

/* Adjust layout when visuals are wide on Desktop */
.detail-container:has(.iphone-landscape),
.detail-container:has(.ipad-landscape),
.detail-container:has(.mac-landscape),
.detail-container:has(.tv-landscape) {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-container:has(.iphone-landscape) .detail-visuals,
.detail-container:has(.ipad-landscape) .detail-visuals,
.detail-container:has(.mac-landscape) .detail-visuals,
.detail-container:has(.tv-landscape) .detail-visuals {
    order: 2;
    width: 100%;
}

.detail-container:has(.iphone-landscape) .detail-info,
.detail-container:has(.ipad-landscape) .detail-info,
.detail-container:has(.mac-landscape) .detail-info,
.detail-container:has(.tv-landscape) .detail-info {
    order: 1;
    margin-bottom: 60px;
}

.slideshow-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slideshow-img.active {
    opacity: 1;
}

.app-store-badge {
    height: 44px;
    margin-top: 20px;
}

/* Footer */
footer {
    padding: 60px 0;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .detail-container {
        flex-direction: column !important;
        align-items: center;
        text-align: center;
        gap: 60px;
        padding-top: 60px;
    }
    
    .detail-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 1 !important;
    }
    
    .detail-visuals {
        order: 2 !important;
    }

    .slideshow-container {
        width: 280px;
        height: auto;
    }
    
    .slideshow-container.landscape,
    .slideshow-container.iphone-landscape,
    .slideshow-container.ipad-landscape,
    .slideshow-container.tv-landscape,
    .slideshow-container.mac-landscape {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    h2.section-title {
        font-size: 2rem;
    }
}
