/* LUMO - Telegram Mini App Styles */
/* Based on Tilda design: dark purple theme */

:root {
    --color-bg: #110051;
    --color-bg-header: #4400bc;
    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-accent: #f4c373;
    --color-badge-bg: rgba(255, 255, 255, 0.25);
    --color-card-rounded: #110051;
    --font-main: 'Open Sans', Arial, sans-serif;
    --radius-card: 20px;
    --radius-badge: 5px;
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

#app {
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: 100px;
}

/* Header */
.header {
    background: var(--color-bg-header);
    padding: 15px 20px 70px;
    text-align: center;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--color-bg);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 40px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin-bottom: 5px;
}

.tagline {
    font-size: 30px;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 15px;
}

.tagline-divider {
    width: 100%;
    max-width: 380px;
    height: 2px;
    background: var(--color-accent);
    margin: 0 auto 0;
}

/* Play button */
.play-button {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.play-button svg {
    width: 24px;
    height: 24px;
    fill: var(--color-text);
    margin-left: 4px;
}

.card:hover .play-button {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

/* Duration badge */
.duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-badge-bg);
    border-radius: var(--radius-badge);
    font-size: 12px;
    color: var(--color-text);
}

.duration-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--color-text);
}

/* Categories */
.categories {
    padding: 0 0 40px;
}

.category {
    margin-bottom: 10px;
}

.category-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--color-text);
    padding: 15px 20px 10px;
}

/* Cards Scroll Container */
.cards-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 20px 20px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
}

.cards-scroll::after {
    content: '';
    flex: 0 0 20px;
}

.cards-scroll::-webkit-scrollbar {
    display: none;
}

/* Card */
.card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: var(--transition);
}

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

.card:active {
    transform: translateY(-2px);
}

.card-dev {
    opacity: 0.7;
    cursor: default;
}

.card-dev:hover {
    transform: none;
}

/* Card Video Placeholder */
.card-video-placeholder {
    width: 280px;
    height: 210px;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, #2a1a5e 0%, #1a0a4e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-card);
}

.dev-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-badge-bg);
    border-radius: var(--radius-badge);
    font-size: 12px;
    color: var(--color-text);
}

.dev-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--color-text);
}

/* Card Content */
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.card-text {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin-top: 5px;
    max-width: 280px;
}

/* Audio Player (Fullscreen) */
.audio-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.audio-player.active {
    display: flex;
}

/* Background Image */
.player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-color: #1a0a4e;
}

/* Gradient Overlay */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 30%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.6) 80%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

/* Close Button */
.player-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.player-close svg {
    width: 24px;
    height: 24px;
}

/* Content Container */
.player-content {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    padding-bottom: 60px;
}

/* Title Section */
.player-info {
    text-align: center;
    margin-bottom: auto;
    padding-top: 35%;
}

.player-title {
    font-size: 28px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.player-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Player Controls */
.player-controls {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
}

.progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Time Display */
.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.control-btn {
    border: none;
    background: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Play Button */
.play-btn {
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 50%;
    color: #1a0a4e;
}

.play-btn svg {
    width: 32px;
    height: 32px;
    margin-left: 3px;
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Skip Buttons */
.skip-btn {
    width: 56px;
    height: 56px;
    position: relative;
}

.skip-btn svg {
    width: 32px;
    height: 32px;
}

.skip-text {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Safe area for player */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .player-content {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    .player-close {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* Scrollbar for desktop */
@media (min-width: 768px) {
    .cards-scroll {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }
    
    .cards-scroll::-webkit-scrollbar {
        display: block;
        height: 6px;
    }
    
    .cards-scroll::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .cards-scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }
}

/* Safe area for mobile devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(15px + env(safe-area-inset-top));
    }
    
    .footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* Telegram WebApp specific */
body.tg-webapp .header {
    padding-top: 10px;
}

/* Floating Bottom Navigation */
.floating-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(180deg, #1a1a4e 0%, #0f0f3d 100%);
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: 64px;
}

.nav-item-active {
    color: var(--color-text);
}

.nav-item-active .nav-icon {
    background: linear-gradient(135deg, #4a3a8a 0%, #2d2a6e 100%);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 15px rgba(74, 58, 138, 0.5);
}

.nav-item-active .nav-icon svg {
    width: 26px;
    height: 26px;
}

.nav-item:not(.nav-item-active):hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-item:not(.nav-item-active):hover .nav-icon {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.nav-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: all 0.3s ease;
}

.nav-label {
    font-size: 9px;
    font-weight: 400;
    text-align: center;
    line-height: 1.25;
    max-width: 65px;
    word-wrap: break-word;
    hyphens: auto;
}

/* Mobile adjustments for floating nav */
@media (max-width: 420px) {
    .floating-nav {
        height: 85px;
        padding: 0 5px;
        border-radius: 20px 20px 0 0;
    }
    
    .nav-item {
        min-width: 56px;
        padding: 6px 8px;
    }
    
    .nav-item-active .nav-icon {
        width: 48px;
        height: 48px;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .nav-item-active .nav-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .nav-label {
        font-size: 9px;
        max-width: 60px;
    }
}

/* Safe area for floating nav */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .floating-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(90px + env(safe-area-inset-bottom));
    }
    
    #app {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}
