/* lobby.css - Modern Glassmorphism Style for Telegram Mini App */

:root {
    --primary: #40a7e3;
    --primary-dark: #2d8bcb;
    --primary-glow: rgba(64, 167, 227, 0.4);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Background - Sesuai tema Telegram */
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-light: #1a1a1a;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-blur: blur(10px);
    --glass-border: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0) 20%, 
        rgba(255, 255, 255, 0) 80%, 
        rgba(255, 255, 255, 0.4) 100%
    );
    
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);
    
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b6b6b;
    
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    
    /* Safe area insets untuk iPhone */
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(64, 167, 227, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 90px;
    left: 16px;
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--surface-light);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success { background: linear-gradient(135deg, var(--success), #0d9488); border-color: var(--success); }
.toast-error { background: linear-gradient(135deg, var(--danger), #dc2626); border-color: var(--danger); }
.toast-warning { background: linear-gradient(135deg, var(--warning), #d97706); border-color: var(--warning); }
.toast-info { background: linear-gradient(135deg, var(--info), #2563eb); border-color: var(--info); }

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Main Container */
.lobby-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
    min-height: 100vh;
}

/* Profile Card - Glassmorphism */
.profile-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow);
}

.profile-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: var(--glass-border);
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar i {
    font-size: 24px;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 15px;
    font-weight: 600;
}

.profile-username {
    font-size: 12px;
    color: var(--text-muted);
}

.stats-right {
    display: flex;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-item i {
    font-size: 16px;
    color: var(--primary);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, rgba(64, 167, 227, 0.1), rgba(64, 167, 227, 0.05));
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(64, 167, 227, 0.1), transparent);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.welcome-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.welcome-icon i {
    font-size: 28px;
    color: white;
}

.welcome-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

.welcome-text h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 16px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
    transition: all 0.2s;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: var(--glass-border);
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(64, 167, 227, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.stat-card-icon i {
    font-size: 20px;
    color: var(--primary);
}

.stat-card-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-header i {
    font-size: 18px;
    color: var(--primary);
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.section-badge {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

/* Giveaway List */
.giveaway-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Giveaway Card */
.giveaway-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    border: none;
}

.giveaway-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: var(--glass-border);
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.giveaway-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.giveaway-card:active {
    transform: scale(0.98);
}

.giveaway-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.giveaway-icon i {
    font-size: 24px;
    color: white;
}

.giveaway-info {
    flex: 1;
    min-width: 0;
}

.giveaway-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.giveaway-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.giveaway-prize, .giveaway-participants {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.giveaway-prize i, .giveaway-participants i {
    font-size: 10px;
    color: var(--primary);
}

.giveaway-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--warning);
}

.giveaway-time i {
    font-size: 10px;
}

.giveaway-arrow {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.giveaway-arrow i {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.empty-state::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: var(--glass-border);
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
}

.empty-state span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Skeleton Loading */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    gap: 14px;
}

.skeleton-avatar {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
}

.skeleton-title {
    width: 60%;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    width: 80%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-text.short {
    width: 40%;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.fab-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.fab-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 1.5px;
    background: linear-gradient(35deg, 
        rgba(0, 0, 0, 0.6) 0%, 
        rgba(0, 0, 0, 0) 10%,
        rgba(0, 0, 0, 0) 90%, 
        rgba(0, 0, 0, 0.6) 100%
    );
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.fab-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    padding: 1px;
    background: linear-gradient(170deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 60%, 
        rgba(255, 255, 255, 0.3) 100%
    );
    -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.fab-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.fab-btn:active {
    transform: translateY(1px) scale(0.98);
}

.fab-btn i {
    font-size: 16px;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
    .lobby-container {
        padding: 12px;
        padding-bottom: 90px;
    }
    
    .stats-right {
        gap: 12px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-card-value {
        font-size: 18px;
    }
    
    .welcome-icon {
        width: 48px;
        height: 48px;
    }
    
    .welcome-icon i {
        font-size: 24px;
    }
    
    .giveaway-icon {
        width: 44px;
        height: 44px;
    }
    
    .giveaway-icon i {
        font-size: 20px;
    }
}

/* Scroll Prevention Styles - untuk MiniApp Telegram */
body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for cleaner look */
.lobby-container::-webkit-scrollbar {
    width: 0;
    background: transparent;
}