/* =========================================
   iOS DARK GLASSMORPHISM VARIABLES
   ========================================= */
:root {
    --primary: #5e5ce6; 
    --primary-hover: #7d7aff;
    --success: #32d74b; 
    --danger: #ff453a; 
    --info: #0a84ff; 
    --warning: #ffd60a;
    
    --bg-dark: #050505;
    --text-main: #ffffff;
    --text-muted: #ebebf599; 
    
    --glass-bg: rgba(28, 28, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-tap-highlight-color: transparent; }

body, html { height: 100%; width: 100%; background-color: var(--bg-dark); color: var(--text-main); overflow: hidden; }

/* --- PREMIUM ANIMATED GRADIENT BACKGROUND --- */
.ambient-bg { 
    position: fixed; inset: 0; z-index: -1; 
    background: linear-gradient(-45deg, #0a0a0a, #1a0b2e, #001f3f, #1e001e);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Subtle Glows overlaying the gradient */
.glow-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.4; animation: floatGlow 12s infinite alternate ease-in-out; }
.glow-1 { top: -10%; left: -10%; width: 300px; height: 300px; background: #5e5ce6; }
.glow-2 { bottom: 10%; right: -10%; width: 250px; height: 250px; background: #bf5af2; }
@keyframes floatGlow { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 50px) scale(1.1); } }

.app-container { display: flex; flex-direction: column; height: 100%; width: 100%; position: absolute; inset: 0; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
button { cursor: pointer; transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); border: none; outline: none; }
button:active { transform: scale(0.95); }

/* --- iOS GLASS HEADER --- */
.app-header { background: rgba(18, 18, 18, 0.65); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); padding: 16px 20px calc(16px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--glass-border); z-index: 10; position: relative; }
.header-left { display: flex; align-items: center; gap: 12px; }

.domain-logo { 
    font-size: 20px; 
    font-weight: 800; 
    letter-spacing: -0.5px; 
    background: linear-gradient(135deg, #ffffff, #a5a5ab); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* Profile & Search Icons in Header */
.header-right { position: relative; display: flex; align-items: center; gap: 10px; }

.header-search-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-main); font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
}
.header-search-btn:hover { background: rgba(255,255,255,0.1); }

.user-dp, .guest-dp { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; color: var(--text-main); font-size: 16px; background: rgba(255,255,255,0.1); cursor: pointer; }
.user-dp { display: none; }

.profile-dropdown { position: absolute; top: 55px; right: 0; background: rgba(30, 30, 32, 0.85); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.5); width: 230px; display: none; flex-direction: column; overflow: hidden; z-index: 100; transform-origin: top right; animation: slideDownFade 0.2s ease; }
.profile-dropdown.show { display: flex; }
@keyframes slideDownFade { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.pd-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 12px; }
.pd-header img, .pd-header .guest-icon { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 18px;}
.pd-info { flex: 1; overflow: hidden; }
.pd-info h4 { font-size: 14px; font-weight: 700; color: white; margin-bottom: 2px; }
.pd-info p { font-size: 11px; color: var(--info); font-weight: 600; }

.pd-menu { padding: 8px; }
.pd-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; color: white; border-radius: 12px; text-decoration: none; cursor: pointer; transition: 0.2s; background: transparent; width: 100%; text-align: left;}
.pd-item:hover { background: rgba(255,255,255,0.1); }
.pd-item i { font-size: 16px; width: 20px; text-align: center; color: var(--text-muted); }
.pd-item.danger { color: var(--danger); margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.1); border-radius: 0 0 12px 12px; }
.pd-item.danger i { color: var(--danger); }

/* Main Content */
.main-content { flex: 1; overflow-y: auto; padding-bottom: 100px; position: relative; }
.main-content::-webkit-scrollbar { display: none; }

/* --- TOGGLE SEARCH BOX --- */
.store-search-wrap { 
    display: none; padding: 12px 20px; position: sticky; top: 0; z-index: 9; 
    background: rgba(18, 18, 18, 0.9); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border);
    animation: slideDownSearch 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDownSearch { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.store-search { position: relative; width: 100%; display: flex; align-items: center; }
.store-search i.fa-magnifying-glass { position: absolute; left: 16px; color: var(--text-muted); font-size: 14px; }
.store-search input { width: 100%; background: rgba(118, 118, 128, 0.24); border: 1px solid rgba(255,255,255,0.05); padding: 12px 40px 12px 40px; border-radius: 16px; font-size: 14px; color: white; font-weight: 500; outline: none; transition: 0.2s;}
.store-search input:focus { background: rgba(118, 118, 128, 0.35); border-color: rgba(255,255,255,0.2); }
.close-search-btn { position: absolute; right: 12px; background: transparent; color: var(--text-muted); font-size: 16px; padding: 5px; }

/* --- BANNER SLIDER --- */
.banner-slider-container { position: relative; margin: 20px 20px 10px 20px; height: 125px; border-radius: 24px; overflow: hidden; box-shadow: 0 15px 30px rgba(0,0,0,0.4); border: 1px solid var(--glass-border);}
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: 0.6s ease-in-out; display: flex; align-items: center; justify-content: space-between; padding: 24px; color: white; }
.slide.active { opacity: 1; visibility: visible; z-index: 2;}

.featured-banner { background: linear-gradient(135deg, rgba(30,30,30,0.8), rgba(94,92,230,0.6)); backdrop-filter: blur(10px); }
.featured-icon-wrap { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 26px; z-index: 2; flex-shrink: 0; }
.featured-info { flex: 1; z-index: 2; margin-left: 15px;}
.featured-badge { font-size: 9px; font-weight: 800; padding: 4px 10px; border-radius: 12px; text-transform: uppercase; display: inline-block; margin-bottom: 6px; letter-spacing: 1px;}
.featured-info h3 { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.featured-info p { font-size: 11px; opacity: 0.9; font-weight: 500;}

.request-banner { background: linear-gradient(135deg, rgba(10,132,255,0.6), rgba(191,90,242,0.6)); backdrop-filter: blur(10px);}
.req-content { z-index: 2; max-width: 60%;}
.req-content h4 { font-size: 18px; font-weight: 800; margin-bottom: 4px;}
.req-content p { font-size: 11px; font-weight: 600; opacity: 0.9; }
.request-banner button { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: white; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 12px; z-index: 2;}

/* --- TABS --- */
.cat-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 15px 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill { flex-shrink: 0; padding: 8px 18px; border-radius: 20px; background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); color: var(--text-muted); font-size: 12px; font-weight: 600; transition: 0.3s;}
.cat-pill.active { background: white; color: black; font-weight: 700; border-color: white; }

/* --- ADMIN UPLOAD FORM --- */
.admin-form-card { background: rgba(30, 30, 32, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin: 0 20px 20px 20px; padding: 24px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.admin-form-group { margin-bottom: 18px; text-align: left; }
.admin-form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
.admin-form-group input, .admin-form-group textarea, .admin-form-group select { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); color: white; font-size: 14px; font-weight: 500; outline: none; transition: 0.2s;}
.admin-form-group input:focus, .admin-form-group textarea:focus, .admin-form-group select:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); }
.admin-form-group textarea { min-height: 80px; resize: vertical; }

.file-upload-btn { width: 100%; background: rgba(0,0,0,0.3); border: 2px dashed rgba(255,255,255,0.2); color: white; padding: 16px; border-radius: 14px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s;}
.btn-publish { width: 100%; padding: 16px; background: var(--primary); color: white; border: none; border-radius: 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.btn-cancel-edit { width: 100%; padding: 14px; background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; font-size: 14px; font-weight: 600; margin-top: 10px; display: none; }

/* --- iOS APP CARDS --- */
.list-heading { font-size: 14px; font-weight: 700; color: white; padding: 0 20px; margin: 10px 0 15px 0; letter-spacing: -0.3px; display: flex; justify-content: space-between; align-items: center;}

.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 14px; padding: 0 20px; }
.store-app-item { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--glass-bg); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); border-radius: 22px; padding: 18px 12px; position: relative; transition: 0.3s; box-shadow: var(--shadow-glass);}

.store-app-icon { width: 72px; height: 72px; border-radius: 22.5%; object-fit: cover; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }

.store-app-title { 
    font-size: 13px; font-weight: 600; color: white; margin-bottom: 12px; 
    width: 100%; display: block; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

.app-btn-group { display: flex; gap: 8px; width: 100%; margin-top: auto; }
.btn-details { width: 36px; height: 36px; flex-shrink: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); color: white; font-size: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;}

/* --- SHIMMER GET BUTTON --- */
@keyframes shimmerBtn {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}
.btn-download { 
    flex: 1; height: 36px; 
    background: linear-gradient(135deg, var(--primary), var(--info)); 
    color: white; 
    border-radius: 18px; 
    font-weight: 700; 
    font-size: 12px; 
    display: flex; align-items: center; justify-content: center; gap: 6px; 
    position: relative; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}
.btn-download::after {
    content: ''; position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    animation: shimmerBtn 2.5s infinite;
}

.admin-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 5;}
.btn-action-app { border: none; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; backdrop-filter: blur(5px);}
.btn-action-app.edit { background: rgba(10, 132, 255, 0.3); color: white; border: 1px solid rgba(10, 132, 255, 0.5);}
.btn-action-app.del { background: rgba(255, 69, 58, 0.3); color: white; border: 1px solid rgba(255, 69, 58, 0.5);}

/* --- ROUNDED PROFESSIONAL BOTTOM NAVBAR --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; justify-content: space-around; align-items: center;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    z-index: 50;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: rgba(255, 255, 255, 0.4); text-decoration: none; font-size: 10px; font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); width: 70px; position: relative;
}
.nav-item i { font-size: 20px; transition: 0.3s ease; margin-bottom: 2px;}
.nav-item.active { color: #ffffff; font-weight: 600; }
.nav-item.active i { transform: translateY(-2px); color: var(--primary); }

.nav-item::after {
    content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%) scale(0);
    width: 4px; height: 4px; border-radius: 50%; background: var(--primary); transition: 0.3s ease;
}
.nav-item.active::after { transform: translateX(-50%) scale(1); }

/* --- GLASS DETAILS MODAL --- */
.details-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); z-index: 100000; align-items: center; justify-content: center; animation: fadeIn 0.2s ease;}
.details-overlay.show { display: flex; }
.details-modal { background: rgba(30, 30, 32, 0.75); border: 1px solid rgba(255,255,255,0.15); width: 90%; max-width: 380px; border-radius: 32px; padding: 24px; text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.5); position: relative; animation: slideUpFade 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes slideUpFade { from { transform: translateY(40px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.dm-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; background: rgba(255,255,255,0.1); border: none; border-radius: 50%; color: var(--text-muted); display:flex; align-items:center; justify-content:center;}
.dm-icon { width: 85px; height: 85px; border-radius: 22.5%; object-fit: cover; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 10px 20px rgba(0,0,0,0.4);}
.dm-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.dm-desc-box { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 16px; font-size: 13px; color: var(--text-muted); line-height: 1.5; text-align: left; margin: 15px 0; max-height: 150px; overflow-y: auto; border: 1px solid rgba(255,255,255,0.05);}
.dm-download-btn { width: 100%; height: 50px; background: linear-gradient(135deg, var(--primary), var(--info)); color: white; font-size: 15px; font-weight: 700; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; position: relative; overflow: hidden;}
.dm-download-btn::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg); animation: shimmerBtn 2.5s infinite;
}

/* Star Rating */
.star-rating-box { margin-bottom: 15px; background: rgba(255, 255, 255, 0.05); padding: 12px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1);}
.star-rating-box p { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px;}
.stars-container i { font-size: 24px; color: rgba(255,255,255,0.2); cursor: pointer; transition: 0.2s; margin: 0 4px;}
.stars-container i.active { color: #ffd60a; filter: drop-shadow(0 0 5px rgba(255, 214, 10, 0.5));}

/* --- ERROR SHAKE ANIMATION --- */
.shake-animation { animation: shake 0.4s; border-color: var(--danger) !important; }
@keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } 100% { transform: translateX(0); } }

/* --- FIXED & UPGRADED TOAST --- */
.toast-box { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 100005; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 350px; pointer-events: none; }
.toast { background: rgba(40, 40, 40, 0.95); backdrop-filter: blur(15px); color: white; padding: 14px 16px; border-radius: 100px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 600; animation: slideDownToast 0.4s forwards; }
.toast.error { background: rgba(40, 10, 10, 0.95); border: 1px solid rgba(255, 69, 58, 0.4); color: #ff453a; }
@keyframes slideDownToast { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.global-overlay { display: none; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 9999; flex-direction: column; align-items: center; justify-content: center; color: white; }
.global-overlay .spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--info); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.global-overlay .upload-text { font-size: 14px; font-weight: 600; }
