/* ==========================================================================
   Components - AppsLuna
   ========================================================================== */

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    border-radius: var(--radius-full);
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        background var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

/* Primary button */
.btn--primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: 1px solid var(--text-primary);
}

.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-white);
}

/* Secondary button */
.btn--secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--border-color);
    border-color: var(--border-color-hover);
}

/* Ghost button */
.btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

/* Magnetic button effect (enhanced with JS) */
.btn--magnetic {
    will-change: transform;
}

/* Button icon */
.btn__icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.btn:hover .btn__icon {
    transform: translate(3px, -3px);
}

/* ==========================================================================
   Product Card
   ========================================================================== */

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition:
        transform var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-slow);
    will-change: transform;
}

/* Glow effect layer */
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
    z-index: 0;
}

.product-card--otter::before {
    background: var(--gradient-glow-otter);
}

.product-card--wordwise::before {
    background: var(--gradient-glow-wordwise);
}

.product-card--mydoll::before {
    background: var(--gradient-glow-mydoll);
}

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

.product-card:hover {
    transform: translateY(-8px);
}

.product-card--otter:hover {
    border-color: var(--otter-color);
    box-shadow: var(--shadow-glow-otter);
}

.product-card--wordwise:hover {
    border-color: var(--wordwise-color);
    box-shadow: var(--shadow-glow-wordwise);
}

.product-card--mydoll:hover {
    border-color: var(--mydoll-color);
    box-shadow: var(--shadow-glow-mydoll);
}

/* Card content */
.product-card__content {
    position: relative;
    z-index: 1;
}

/* Card header */
.product-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.product-card__icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.product-card__info {
    flex: 1;
    min-width: 0;
}

.product-card__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
}

.product-card__tagline {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.product-card__description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   Badge
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--live {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge--coming {
    background: rgba(124, 58, 237, 0.15);
    color: var(--wordwise-color-light);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ==========================================================================
   Store Buttons
   ========================================================================== */

.store-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-base);
}

.store-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.store-btn__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.store-btn__text {
    text-align: left;
}

.store-btn__label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.store-btn__name {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
}

/* ==========================================================================
   Carousel
   ========================================================================== */

.carousel-container {
    position: relative;
    margin-bottom: var(--space-lg);
}

.carousel {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-sm) 0;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    position: relative;
}

.carousel__image {
    height: 280px;
    width: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.carousel__item:hover .carousel__image {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Carousel dots */
.carousel__dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition:
        background var(--transition-fast),
        transform var(--transition-base);
    padding: 0;
}

.carousel__dot:hover {
    background: var(--text-muted);
}

.carousel__dot--active {
    transform: scale(1.3);
}

.product-card--otter .carousel__dot--active {
    background: var(--otter-color);
}

.product-card--wordwise .carousel__dot--active {
    background: var(--wordwise-color);
}

.product-card--mydoll .carousel__dot--active {
    background: var(--mydoll-color);
}

/* ==========================================================================
   Bento Grid
   ========================================================================== */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: var(--container-xl);
    margin: 0 auto;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
    transition:
        transform var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.bento-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
}

/* Bento sizes */
.bento-item--large {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 300px;
}

.bento-item--wide {
    grid-column: span 2;
}

.bento-item--tall {
    grid-row: span 2;
}

/* Bento content */
.bento-item__icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    flex-shrink: 0;
}

.bento-item--otter .bento-item__icon {
    color: var(--otter-color);
}

.bento-item--wordwise .bento-item__icon {
    color: var(--wordwise-color);
}

.bento-item__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-sm);
}

.bento-item__description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Bento accent colors */
.bento-item--otter:hover {
    border-color: var(--otter-color);
    box-shadow: 0 8px 32px rgba(79, 195, 247, 0.1);
}

.bento-item--wordwise:hover {
    border-color: var(--wordwise-color);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

/* ==========================================================================
   Section Header
   ========================================================================== */

.section-header {
    text-align: center;
    margin-bottom: var(--space-4xl);
}

.section-header__title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
}

.section-header__subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Responsive - Components
   ========================================================================== */

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-item--large {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 200px;
    }

    .bento-item--wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .product-card {
        padding: var(--space-lg);
    }

    .product-card__header {
        flex-wrap: wrap;
    }

    .product-card__icon {
        width: 56px;
        height: 56px;
    }

    .product-card__title {
        font-size: var(--font-size-xl);
    }

    .carousel__image {
        height: 380px;
    }

    .store-buttons {
        flex-direction: column;
    }

    .store-btn {
        justify-content: center;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-item--large,
    .bento-item--wide {
        grid-column: span 1;
    }

    .section-header__title {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 480px) {
    .product-card {
        padding: var(--space-md);
    }

    .carousel__image {
        height: 320px;
    }

    .btn {
        padding: var(--space-sm) var(--space-lg);
    }
}

/* ==========================================================================
   Portfolio / Success Cases
   ========================================================================== */

.portfolio {
    padding: var(--space-5xl) var(--space-xl);
    position: relative;
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: var(--space-xl);
    max-width: var(--container-2xl);
    margin: 0 auto;
}

.portfolio-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition:
        transform var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-slow);
}

.portfolio-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.portfolio-card__info {
    flex: 1;
}

.portfolio-card__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
}

.portfolio-card__client {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.portfolio-card__platforms {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.portfolio-card__platform {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.portfolio-card__description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: var(--line-height-relaxed);
    font-size: var(--font-size-sm);
}

.portfolio-card__stats {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.portfolio-card__stat {
    text-align: center;
}

.portfolio-card__stat-value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--otter-color);
    display: block;
}

.portfolio-card__stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Portfolio Screenshots - Mobile Apps */
.portfolio-card__screenshots {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-lg);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.portfolio-card__screenshots::-webkit-scrollbar {
    display: none;
}

.portfolio-card__screenshot {
    height: 240px;
    width: auto;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.portfolio-card__screenshot:hover {
    transform: scale(1.02);
}

/* Portfolio Screenshots - Desktop (Overlapping Layout) */
.portfolio-card__desktop-preview {
    position: relative;
    margin-bottom: var(--space-lg);
    padding-bottom: 20px;
}

.portfolio-card__desktop-main {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.portfolio-card__desktop-overlay {
    position: absolute;
    bottom: 0;
    right: var(--space-md);
    width: 45%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--bg-card);
}

/* Portfolio Store Links */
.portfolio-card__links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.portfolio-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
}

.portfolio-card__link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.portfolio-card__link-icon {
    width: 16px;
    height: 16px;
}

/* Badge for highlights */
.badge--highlight {
    background: linear-gradient(135deg, var(--otter-color), var(--wordwise-color));
    color: white;
    border: none;
    font-weight: var(--font-weight-semibold);
}

/* Responsive - Portfolio */
@media (max-width: 768px) {
    .portfolio {
        padding: var(--space-3xl) var(--space-md);
    }

    .portfolio-card {
        padding: var(--space-lg);
    }

    .portfolio-card__screenshot {
        height: 200px;
    }

    .portfolio-card__stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .portfolio-card__desktop-overlay {
        width: 50%;
        right: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .portfolio-card__screenshot {
        height: 180px;
    }

    .portfolio-card__links {
        flex-direction: column;
    }

    .portfolio-card__link {
        justify-content: center;
    }
}

/* ==========================================================================
   Language Toggle
   ========================================================================== */

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.lang-toggle:hover {
    border-color: var(--border-color-hover);
}

.lang-toggle__flag {
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.lang-toggle__flag.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

@media (max-width: 768px) {
    .lang-toggle {
        margin-top: var(--space-md);
    }
}
