/* =========================================
   DevMan07x - 2026 Futuristic Glassmorphism
   ========================================= */
:root {
    --bg-dark: #050508;
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.4);
    --secondary: #7000ff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8b8b93;
    --radius-lg: 24px;
    --radius-md: 16px;
    --squircle: 35%;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Dynamic Background */
body::before {
    content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(112,0,255,0.1) 0%, rgba(0,240,255,0.05) 30%, transparent 60%);
    animation: rotateBg 40s linear infinite; z-index: -1; pointer-events: none;
}
@keyframes rotateBg { 100% { transform: rotate(360deg); } }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.main-content { flex: 1; padding: 30px 0; }

/* Header */
header {
    background: rgba(5, 5, 8, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border); padding: 15px 0; position: sticky; top: 0; z-index: 100;
}
header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.title-container { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 15px var(--primary-glow); }
h1 { font-size: 22px; font-weight: 700; background: linear-gradient(90deg, var(--primary), #fff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.search-box { position: relative; width: 100%; max-width: 350px; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--text-muted); }
#search {
    width: 100%; padding: 12px 20px 12px 45px; border: 1px solid var(--glass-border);
    border-radius: 30px; font-size: 15px; background: rgba(255,255,255,0.03); color: #fff;
    transition: all 0.3s ease; font-family: 'Outfit', sans-serif; outline: none;
}
#search:focus { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); background: rgba(255,255,255,0.08); }

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: var(--radius-lg);
}

/* Site Intro */
.site-intro { padding: 30px; text-align: center; margin-bottom: 30px; }
.site-intro h2 { font-size: 26px; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.site-intro p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Views */
.view { display: none; animation: fadeIn 0.4s ease forwards; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* App Grid */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.app-card {
    padding: 20px 15px; text-align: center; cursor: pointer; position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.app-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 10px 30px var(--primary-glow); }
.app-icon { width: 80px; height: 80px; border-radius: var(--squircle); margin-bottom: 15px; object-fit: cover; transition: 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.app-card:hover .app-icon { transform: scale(1.08); }
.app-card h3 { font-size: 15px; margin-bottom: 5px; }
.app-card-date { font-size: 12px; color: var(--text-muted); margin-bottom: 15px; }

/* Buttons */
.btn-card-download, .btn-primary, .btn-success {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-weight: 600; border: none; cursor: pointer; transition: all 0.3s ease; border-radius: 30px;
}
.btn-card-download { width: 100%; padding: 10px; font-size: 13px; color: #fff; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.app-card:hover .btn-card-download { background: var(--primary); color: #000; border-color: transparent; }

.btn-primary { background: linear-gradient(135deg, var(--primary), #00b0ff); color: #000; padding: 15px 30px; font-size: 16px; width: 100%; max-width: 300px; }
.btn-success { background: linear-gradient(135deg, #00ff88, #00b35f); color: #000; padding: 18px 30px; font-size: 18px; width: 100%; max-width: 350px; }
.glow-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px var(--primary-glow); }
.pulse-anim { animation: pulseBtn 2s infinite; }
@keyframes pulseBtn { 0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(0, 255, 136, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); } }

/* App Detail */
.app-detail-card { max-width: 600px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.app-icon-wrapper { position: relative; display: inline-block; margin-bottom: 20px; }
.app-icon-large { width: 120px; height: 120px; border-radius: var(--squircle); object-fit: cover; box-shadow: 0 15px 35px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1); }
.app-icon-medium { width: 90px; height: 90px; border-radius: var(--squircle); margin-bottom: 15px; }
.glow-text { text-shadow: 0 0 15px rgba(255,255,255,0.3); margin-bottom: 10px; }
.stars { color: var(--primary); font-size: 20px; letter-spacing: 2px; margin-bottom: 15px; }
.stats-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-box { background: rgba(0,240,255,0.05); border: 1px solid rgba(0,240,255,0.1); padding: 8px 16px; border-radius: 20px; font-size: 13px; color: #fff; }

/* Back Button & Cancel Button */
.back-btn { 
    background: linear-gradient(135deg, #ff8c00, #ff5100); /* تدرج برتقالي واضح ومشرق */
    color: #ffffff; 
    border: none; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    padding: 12px 25px; 
    border-radius: 30px; 
    margin: 0 auto 25px auto; 
    box-shadow: 0 5px 15px rgba(255, 81, 0, 0.3); /* توهج برتقالي خفيف */
    transition: all 0.3s ease; 
}

/* تأثير عند تمرير الماوس */
.back-btn:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 25px rgba(255, 81, 0, 0.5); /* زيادة التوهج */
    color: #ffffff; 
}

/* تحريك السهم قليلاً عند تمرير الماوس */
.back-btn svg {
    transition: transform 0.3s ease;
}
.back-btn:hover svg {
    transform: translateX(-4px);
}

/* زر الإلغاء في شاشة العداد */
.back-btn-small {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 14px;
}

/* Badges */
.badge { position: absolute; top: -10px; right: -10px; background: var(--secondary); color: #fff; padding: 5px 12px; border-radius: 12px; font-size: 12px; font-weight: bold; box-shadow: 0 4px 10px rgba(112,0,255,0.5); border: 1px solid rgba(255,255,255,0.2); }
.badge.free { background: #00c853; box-shadow: 0 4px 10px rgba(0,200,83,0.5); }

/* Countdown */
.countdown-circle { width: 140px; height: 140px; border: 3px solid rgba(255,255,255,0.05); border-top-color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 25px auto; animation: spin 1s linear infinite; position: relative; }
.countdown-circle span { font-size: 48px; font-weight: bold; animation: spinReverse 1s linear infinite; color: var(--primary); text-shadow: 0 0 15px var(--primary-glow); }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spinReverse { 100% { transform: rotate(-360deg); } }
.progress-bar-container { width: 100%; height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; transition: width 0.2s; box-shadow: 0 0 10px var(--primary); }
.wait-text { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* Ads Configuration */
.ad-container { border-radius: var(--radius-md); overflow: hidden; margin: 20px auto; text-align: center; max-width: 100%; }
.ad-container img { max-width: 100%; height: auto; border-radius: var(--radius-md); transition: 0.3s; }
.ad-container a:hover img { transform: scale(1.02); opacity: 0.9; }

/* Bottom Banner Specific - Smooth Transition */
.ad-bottom {
    max-width: 728px;
    margin: 10px auto 30px;
    padding: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Popup & Toast */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: 0.3s; }
.popup-overlay.show { opacity: 1; visibility: visible; }
.popup { width: 90%; max-width: 400px; padding: 30px; text-align: center; position: relative; transform: scale(0.9); transition: 0.3s; }
.popup-overlay.show .popup { transform: scale(1); }
.close-btn { position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.1); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.close-btn:hover { background: var(--primary); color: #000; }
.tg-icon-wrapper { width: 60px; height: 60px; color: #0088cc; margin: 0 auto 15px; }
.btn-telegram { background: #0088cc; color: #fff; padding: 12px 25px; border-radius: 12px; display: inline-block; width: 100%; text-decoration: none; margin-top: 20px; font-weight: bold; }
.btn-telegram:hover { background: #00aaff; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 50px); background: rgba(0,240,255,0.1); border: 1px solid var(--primary); color: #fff; padding: 12px 25px; border-radius: 30px; backdrop-filter: blur(10px); opacity: 0; transition: 0.3s; z-index: 1000; font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
footer { border-top: 1px solid var(--glass-border); padding: 20px 0; text-align: center; margin-top: auto; font-size: 14px; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    header .container { flex-direction: column; align-items: stretch; }
    .title-container { justify-content: center; margin-bottom: 10px; }
    .search-box { max-width: 100%; }
    .app-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .app-card { padding: 15px 10px; }
    .app-icon { width: 65px; height: 65px; }
    .app-icon-large { width: 100px; height: 100px; }
    .btn-card-download { padding: 8px; font-size: 12px; }
    .btn-card-download span { display: none; }
    .btn-card-download::after { content: 'Download'; }
}