:root {
    --bg: #e0e5ec;
    --text: #2d3748;
    --primary: #10b981;
    --shadow-light: #ffffff;
    --shadow-dark: #a3b1c6;
    --sidebar-width: 250px;
}
[data-theme="dark"] {
    --bg: #1a1f25;
    --text: #e2e8f0;
    --primary: #34d399;
    --shadow-light: #262d36;
    --shadow-dark: #0e1114;
}

*, *::before, *::after { box-sizing: border-box; }

body { font-family: 'Roboto', sans-serif; background: var(--bg); color: var(--text); margin: 0; transition: background 0.3s, color 0.3s; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* 3D Morphism Utilities */
.card-3d { background: var(--bg); border-radius: 12px; box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light); transition: all 0.3s ease; }
.btn-3d { background: var(--bg); color: var(--primary); border: none; padding: 10px 20px; border-radius: 10px; font-weight: bold; cursor: pointer; box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light); transition: all 0.2s ease; }
.btn-3d:hover { box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light); transform: translateY(2px); }
.btn-3d:active { box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light); }
.input-3d { width: 100%; padding: 12px; border: none; outline: none; background: var(--bg); color: var(--text); border-radius: 10px; box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light); }

/* Layout Framework */
.wrapper { display: flex; min-height: 100vh; width: 100%; }
.sidebar { width: var(--sidebar-width); background: var(--bg); padding: 15px; box-shadow: 4px 0 10px var(--shadow-dark); display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 1000; transition: 0.3s; }
.sidebar h2 { color: var(--primary); text-align: center; margin-top: 10px; margin-bottom: 25px; text-shadow: 1px 1px 2px var(--shadow-dark); }
.sidebar a { display: block; padding: 12px 15px; margin-bottom: 10px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light); transition: 0.2s; }
.sidebar a:active, .sidebar a.active { box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light); color: var(--primary); }

.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 20px 30px; transition: 0.3s; width: calc(100% - var(--sidebar-width)); display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; margin-bottom: 25px; border-radius: 12px; box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light); }
.menu-btn { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; padding: 0 10px; }

/* Desktop Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.stat-card { padding: 20px; text-align: center; border-radius: 12px; }

h2 { margin: 25px 0 15px 0; font-size: 20px; }

/* Play Store App Cards */
.app-card { padding: 15px; text-align: center; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 100%; }
.app-card img { width: 75px; height: 75px; border-radius: 16px; margin-bottom: 10px; box-shadow: 2px 2px 6px var(--shadow-dark), -2px -2px 6px var(--shadow-light); object-fit: cover; }
.app-card h3 { font-size: 14px; margin: 0 0 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Reviews UI */
.review-item { padding: 15px; margin-bottom: 15px; border-radius: 10px; background: var(--bg); box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light); }

/* Pagination Controls */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 30px; margin-bottom: 30px; }
.pagination .page-number { font-weight: bold; opacity: 0.8; font-size: 14px; }
.pagination a.disabled { opacity: 0.3; pointer-events: none; box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 10px 0 20px rgba(0,0,0,0.2), 100vw 0 0 rgba(0,0,0,0.4); }
    .main-content { margin-left: 0; padding: 15px; width: 100%; }
    .menu-btn { display: block; }
    
    .app-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .app-card { padding: 10px 5px; }
    .app-card img { width: 55px; height: 55px; margin-bottom: 8px; border-radius: 12px; }
    .app-card h3 { font-size: 11px; margin-bottom: 3px; }
    .app-card p { font-size: 9px !important; margin-bottom: 5px; }
    .app-card .btn-3d { font-size: 8px !important; padding: 4px 6px !important; margin-top: auto !important; }
}

/* IMAGE LIGHTBOX (ZOOM & SLIDER) */
.lightbox-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.95); z-index: 99999999; display: none; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.lightbox-wrapper { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; padding: 20px; }
.lightbox-img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: zoomIn 0.3s ease; }
.lightbox-close { position: absolute; top: 15px; right: 20px; background: rgba(255,255,255,0.1); border: none; font-size: 30px; color: #fff; cursor: pointer; border-radius: 50%; width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; transition: 0.2s; z-index: 10; }
.lightbox-close:hover { background: #ef4444; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; font-size: 24px; color: #fff; cursor: pointer; border-radius: 50%; width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; transition: 0.2s; z-index: 10; }
.lightbox-nav:hover { background: var(--primary); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* POLITE PWA POPUP BANNER */
.install-popup { position: fixed; bottom: -200px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 400px; background: var(--bg); padding: 20px; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 15px rgba(0,0,0,0.2); z-index: 999999; transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); display: flex; flex-direction: column; align-items: center; border-top: 3px solid var(--primary); }
.install-popup.show { bottom: 0; }
.install-popup h3 { margin: 0 0 10px 0; font-size: 16px; color: var(--text); }
.install-popup p { font-size: 13px; opacity: 0.8; margin: 0 0 15px 0; text-align: center; }
.close-popup { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; opacity: 0.5; }
.close-popup:hover { opacity: 1; color: #ef4444; }

/* MODAL POPUP STYLES */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 9999999; display: none; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-content { background: var(--bg); max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 25px; border-radius: 12px; position: relative; box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light); }