/* =====================================================
   PALACE - COMPONENTS
   =====================================================
   Reusable UI components
   ===================================================== */

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-text);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-surface-border);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--color-text);
    box-shadow: var(--shadow-md), var(--shadow-glow-accent);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(236, 72, 153, 0.5);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-icon {
    width: 24px;
    height: 24px;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: var(--z-fixed);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

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

.logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: all var(--transition-base);
}

.logo:hover img {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: scale(1.1);
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    padding: var(--space-2) 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-fast);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-4);
}

.mobile-nav.open {
    display: block;
}

.mobile-nav .nav-link {
    display: block;
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

.mobile-nav .nav-link:hover {
    background: var(--color-surface);
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
    background: var(--gradient-card);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

/* Feature cards */
.feature-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--text-3xl);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.feature-card h3 {
    margin-bottom: var(--space-3);
}

.feature-card p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* Platform cards */
.platform-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
}

.platform-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.platform-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    font-size: var(--text-2xl);
}

.platform-header h3 {
    margin: 0;
}

.platform-header p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.download-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.download-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-text);
}

.download-btn.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-btn .badge {
    margin-left: auto;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

.download-btn .badge-soon {
    background: var(--color-text-dim);
}

/* =====================================================
   HERO SECTION
   ===================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    pointer-events: none;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(20px, 20px);
    }
}

.hero-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
    z-index: 1;
}

.hero-text {
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
}

.hero-badge span {
    color: var(--color-primary-light);
}

.hero h1 {
    font-size: var(--text-6xl);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero p {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image {
    position: relative;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow: hidden;
    animation: float 4s ease-in-out infinite;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-2xl);
}

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero h1 {
        font-size: var(--text-4xl);
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-image img {
        max-width: 350px;
    }
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-surface-border);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand p {
    color: var(--color-text-muted);
    max-width: 300px;
}

.footer-links h4 {
    color: var(--color-text);
    margin-bottom: var(--space-4);
    font-size: var(--text-base);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.footer-links a:hover {
    color: var(--color-text);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-surface-border);
    color: var(--color-text-dim);
    font-size: var(--text-sm);
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--color-primary);
    color: var(--color-text);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .footer-brand {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* =====================================================
   SCREENSHOT GALLERY
   ===================================================== */

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.screenshot-item {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.screenshot-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.screenshot-item img {
    width: 100%;
    height: auto;
}

/* =====================================================
   PLATFORM BADGES
   ===================================================== */

.platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
}

.platform-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-surface);
    border: 1.5px solid var(--color-surface-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: default;
}

.platform-badge:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.platform-badge svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary-light);
}

/* =====================================================
   FEATURE SHOWCASE (full-page with screenshot backgrounds)
   ===================================================== */

.feature-showcase {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feature-showcase-item {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
}

/* Screenshot as background */
.feature-showcase-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.feature-showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 8s ease;
}

.feature-showcase-item:hover .feature-showcase-image img {
    transform: scale(1.05);
}

/* Dark gradient overlay for readability */
.feature-showcase-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(10, 10, 26, 0.95) 0%,
            rgba(10, 10, 26, 0.7) 30%,
            rgba(10, 10, 26, 0.3) 60%,
            transparent 100%);
    pointer-events: none;
}

/* Text content overlay */
.feature-showcase-content {
    position: relative;
    z-index: 1;
    padding: var(--space-12);
    max-width: 800px;
}

.feature-showcase-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
    font-size: var(--text-4xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.feature-showcase-content h3 {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.feature-showcase-content p {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.8;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.feature-showcase-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    color: var(--color-text);
    font-weight: 500;
}

.feature-tag svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary-light);
}

@media (max-width: 768px) {
    .feature-showcase-item {
        min-height: 80vh;
    }

    .feature-showcase-content {
        padding: var(--space-6);
    }

    .feature-showcase-icon {
        width: 56px;
        height: 56px;
        font-size: var(--text-2xl);
    }

    .feature-showcase-content h3 {
        font-size: var(--text-3xl);
    }

    .feature-showcase-content p {
        font-size: var(--text-lg);
    }

    .feature-tag {
        font-size: var(--text-sm);
        padding: var(--space-1) var(--space-3);
    }
}

@media (max-width: 768px) {
    /* App Icon Section Responsive */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: 1fr 1fr"] > div:first-child {
        order: 1;
    }

    [style*="grid-template-columns: 1fr 1fr"] > div:last-child {
        order: 2;
    }

    [style*="width: 200px"] {
        width: 150px !important;
        height: 150px !important;
    }
}
