/* CPA PRO 3D - ULTIMATE STYLESHEET (v9.1) */

/* --- 1. GLOBAL VARIABLES & RESET --- */
:root {
    --bg-deep: #050510;
    --bg-panel: rgba(10, 15, 30, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --primary: #00d2ff;
    --primary-dim: rgba(0, 210, 255, 0.1);
    --secondary: #7000ff;
    --accent: #ff0055;
    --success: #00ff88;
    --warning: #ffcc00;
    --text-main: #ffffff;
    --text-sec: #a0a0b0;
    --border: rgba(255, 255, 255, 0.08);
    --glow: 0 0 15px var(--primary);
    --font-tech: 'Orbitron', sans-serif;
    --font-ui: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-bn: 'Hind Siliguri', sans-serif;
    --sidebar-w: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: var(--bg-deep); 
    color: var(--text-main); 
    font-family: var(--font-bn), var(--font-body);
    min-height: 100vh; 
    overflow-x: hidden;
    position: relative;
}

/* --- 2. BACKGROUND & SCROLLBAR --- */
#bg-canvas, #canvas-extra { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.anim-container { position: fixed; top:0; left:0; width:100%; height:100%; z-index: -1; pointer-events: none; overflow: hidden; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- 3. GLASS PANEL SYSTEM --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.glass-panel:hover { border-color: rgba(255,255,255,0.2); }

/* --- 4. GRID MENU (DASHBOARD) --- */
.grid-menu {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
.grid-item {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px 5px; text-align: center; cursor: pointer;
    transition: 0.3s; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.grid-item:hover {
    background: var(--primary-dim); border-color: var(--primary);
    transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0, 210, 255, 0.1);
}
.grid-icon { font-size: 28px; margin-bottom: 5px; }
.grid-text { font-family: var(--font-bn); font-weight: 700; font-size: 13px; letter-spacing: 0.5px; }

/* --- 5. BUTTONS --- */
.btn {
    padding: 12px 24px; border-radius: 8px; border: none; cursor: pointer;
    font-family: var(--font-bn); font-weight: 700; font-size: 16px;
    text-transform: uppercase; letter-spacing: 1px;
    transition: 0.3s; position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none;
}
.btn::after {
    content: ''; position: absolute; top:0; left:-100%; width:100%; height:100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}
.btn:hover::after { left: 100%; }
.btn:active { transform: scale(0.96); }

.btn-primary { background: linear-gradient(135deg, var(--primary), #007bff); color: white; box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--border); }
.btn-danger { background: linear-gradient(135deg, #ff4d4d, #b30000); color: white; box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3); }
.btn-success { background: linear-gradient(135deg, #00ff88, #00b359); color: #000; box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3); }

/* --- 6. 3D BUTTONS (TRAFFIC EXCHANGE) --- */
.btn-3d-wrap { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 25px; }
.btn-3d {
    position: relative; display: inline-block; cursor: pointer; outline: none; border: 0;
    vertical-align: middle; text-decoration: none; background: transparent; padding: 0;
    font-size: inherit; font-family: inherit; width: 100%; height: auto;
}
.btn-3d .btn-face {
    position: relative; display: flex; align-items: center; justify-content: center;
    flex-direction: column; width: 100%; height: 60px; border-radius: 12px;
    background: #1c212e; color: #fff; transform-style: preserve-3d;
    transition: transform 0.15s ease-out; border: 1px solid rgba(255,255,255,0.1); z-index: 2;
}
.btn-3d .btn-face i { font-size: 18px; margin-bottom: 4px; }
.btn-3d .btn-face span { font-size: 10px; font-weight: 800; font-family: var(--font-tech); letter-spacing: 1px; }

.btn-3d.style-link .btn-face { background: linear-gradient(180deg, #00d2ff 0%, #007bff 100%); box-shadow: 0 0 10px rgba(0,210,255,0.3); }
.btn-3d.style-link .btn-edge { background: #004d80; }

.btn-3d.style-web .btn-face { background: linear-gradient(180deg, #aa00ff 0%, #7000ff 100%); box-shadow: 0 0 10px rgba(112,0,255,0.3); }
.btn-3d.style-web .btn-edge { background: #3d0080; }

.btn-3d.style-script .btn-face { background: linear-gradient(180deg, #ff0055 0%, #b30000 100%); box-shadow: 0 0 10px rgba(255,0,85,0.3); }
.btn-3d.style-script .btn-edge { background: #80002a; }

.btn-3d.style-auto .btn-face { background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%); color: #000; box-shadow: 0 0 10px rgba(255,215,0,0.3); }
.btn-3d.style-auto .btn-edge { background: #b38600; }

.btn-3d .btn-edge {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 12px; transform: translateY(6px); z-index: 1;
    transition: transform 0.15s ease-out;
}
.btn-3d:hover .btn-face { transform: translateY(-2px); }
.btn-3d:hover .btn-edge { transform: translateY(8px); }
.btn-3d:active .btn-face { transform: translateY(6px); }
.btn-3d:active .btn-edge { transform: translateY(6px); }

/* --- 7. FORMS & INPUTS --- */
.form-control {
    width: 100%; padding: 15px 15px 15px 45px;
    background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 8px; color: white; font-family: var(--font-bn);
    font-size: 16px; transition: 0.3s;
}
select.form-control { padding-left: 15px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300d2ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 15px top 50%; background-size: 12px auto; }

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(0,210,255,0.2); background: rgba(0,0,0,0.5); }
.input-group { position: relative; margin-bottom: 20px; }
.input-group i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-sec); }

/* --- 8. AUTH PAGES (LOGIN/REGISTER) --- */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: 100%; max-width: 420px; padding: 40px; text-align: center; border-top: 2px solid var(--primary); }
.app-container { max-width: 550px; margin: 0 auto; min-height: 100vh; padding-bottom: 100px; position: relative; box-shadow: 0 0 100px rgba(0,0,0,0.5); background: rgba(0,0,0,0.2); }

/* --- 9. USER HEADER --- */
.header {
    padding: 15px 20px; background: rgba(10, 15, 30, 0.9); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar-ring { width: 42px; height: 42px; border-radius: 50%; padding: 2px; background: linear-gradient(var(--primary), var(--secondary)); }
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; background: #000; object-fit: cover; }

.balance-card {
    background: linear-gradient(90deg, #FFD700, #FFA500); padding: 5px 15px; border-radius: 50px;
    color: #000; font-weight: 800; font-family: var(--font-bn); font-size: 16px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); display: flex; align-items: center; gap: 8px;
}

/* --- 10. BOTTOM NAVIGATION --- */
.nav-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 550px;
    background: rgba(10, 15, 30, 0.95); backdrop-filter: blur(15px); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 12px 0; z-index: 100;
    border-radius: 20px 20px 0 0;
}
.nav-item { background: none; border: none; color: var(--text-sec); font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; transition: 0.3s; width: 25%; }
.nav-item i { font-size: 20px; transition: 0.3s; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: translateY(-5px); text-shadow: 0 0 10px var(--primary); }

/* --- 11. TASKS & ADS --- */
.task-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-glass); border: 1px solid var(--border);
    padding: 15px; border-radius: 12px; margin-bottom: 10px; transition: 0.3s;
}
.task-item:hover { background: var(--primary-dim); border-color: var(--primary); transform: translateX(5px); }

.task-progress {
    background: rgba(255,255,255,0.1); border-radius: 20px; height: 14px; width: 100px;
    position: relative; overflow: hidden; margin-top: 5px; border: 1px solid rgba(255,255,255,0.1);
}
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--success), #00b359);
    width: 0%; transition: width 0.5s ease;
}
.progress-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: #fff; font-weight: bold; text-shadow: 0 1px 2px black;
}

/* --- 12. ADMIN PANEL LAYOUT --- */
.admin-layout { display: flex; min-height: 100vh; background: #020205; position: relative; overflow-x: hidden; }
.sidebar { 
    width: var(--sidebar-w); background: #0a0a12; border-right: 1px solid var(--border); 
    position: fixed; height: 100%; z-index: 900; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; flex-direction: column; left: 0;
}
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .sidebar-header span, .sidebar.collapsed .menu-link span { display: none; }
.sidebar.collapsed .sidebar-header i { margin: 0 auto; }
.sidebar.collapsed .menu-link { padding: 15px 0; justify-content: center; }
.sidebar.collapsed .menu-link i { margin: 0; font-size: 20px; }

.sidebar-header { 
    height: 70px; display: flex; align-items: center; padding: 0 20px;
    font-family: var(--font-tech); font-size: 20px; color: var(--primary); 
    letter-spacing: 2px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden;
}
.sidebar-header i { margin-right: 10px; min-width: 24px; text-align: center; }

.menu { flex: 1; padding: 20px 0; overflow-y: auto; overflow-x: hidden; }
.menu-link { 
    display: flex; align-items: center; padding: 15px 25px; color: var(--text-sec); 
    cursor: pointer; transition: 0.2s; border-left: 3px solid transparent; 
    font-family: var(--font-bn); font-size: 16px; font-weight: 500; white-space: nowrap;
}
.menu-link i { min-width: 24px; margin-right: 15px; text-align: center; }
.menu-link:hover, .menu-link.active { background: rgba(0, 210, 255, 0.05); color: white; border-left-color: var(--primary); }

.admin-content { 
    margin-left: var(--sidebar-w); flex: 1; padding: 30px; overflow-y: auto; 
    transition: margin-left 0.3s ease; width: 100%; 
}
.admin-content.expanded { margin-left: 70px; }

.admin-top-bar { display: flex; align-items: center; margin-bottom: 25px; }
.menu-toggle-btn {
    background: none; border: none; color: white; font-size: 24px; cursor: pointer;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: 0.3s;
}
.menu-toggle-btn:hover { background: rgba(255,255,255,0.1); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { padding: 25px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); position: relative; overflow: hidden; }
.stat-card h3 { font-size: 32px; font-family: var(--font-bn); margin-bottom: 5px; color: white; }
.stat-card p { color: var(--text-sec); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-bn); }
.stat-card i { position: absolute; right: 20px; top: 20px; font-size: 40px; opacity: 0.1; }

/* --- 13. MODALS & IFRAMES --- */
.ad-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 2000; display: none; flex-direction: column; }
.ad-topbar { height: 60px; background: #111; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 2px solid var(--primary); box-shadow: 0 5px 20px rgba(0, 210, 255, 0.2); }
.timer-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--secondary); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-family: var(--font-bn); font-size: 18px; border: 2px solid white; box-shadow: 0 0 15px var(--secondary); }

/* --- 14. RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 991px) {
    .sidebar { left: -260px; } 
    .sidebar.active { left: 0; } 
    .admin-content { margin-left: 0; width: 100%; }
    .admin-content.expanded { margin-left: 0; }
    .sidebar-overlay {
        display: none; position: fixed; top:0; left:0; width:100%; height:100%;
        background: rgba(0,0,0,0.5); z-index: 899; backdrop-filter: blur(3px);
    }
    .sidebar-overlay.active { display: block; }
}

.hidden { display: none !important; }
.swal2-popup { background: #151a25 !important; color: white !important; border: 1px solid var(--border) !important; font-family: var(--font-bn) !important; }