/* ============================================================
   PLAY STORE STATUS TRACKER — DASHBOARD STYLES
   Premium dark theme with glassmorphism effects
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.25);
    --accent-green: #22c55e;
    --accent-green-glow: rgba(34, 197, 94, 0.2);
    --accent-yellow: #eab308;
    --accent-yellow-glow: rgba(234, 179, 8, 0.2);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.2);
    --accent-orange: #f97316;
    --accent-purple: #a855f7;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Ambient Background --- */
.bg-effects { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-orb {
    position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}
.bg-orb-1 { width: 600px; height: 600px; background: var(--accent-blue); top: -200px; left: -100px; animation-delay: 0s; }
.bg-orb-2 { width: 500px; height: 500px; background: var(--accent-purple); bottom: -150px; right: -100px; animation-delay: -7s; }
.bg-orb-3 { width: 400px; height: 400px; background: var(--accent-green); top: 40%; left: 50%; animation-delay: -14s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --- App Container --- */
.app-container {
    position: relative; z-index: 1;
    max-width: 1320px; margin: 0 auto;
    padding: 24px 28px 60px;
}

/* --- Header --- */
.header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo-mark {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 4px 20px var(--accent-blue-glow);
}
.header-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.header-subtitle { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.mode-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 100px;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    font-size: 0.75rem; color: var(--text-secondary); font-weight: 500;
}
.mode-badge.demo .mode-dot { background: var(--accent-yellow); box-shadow: 0 0 8px var(--accent-yellow-glow); }
.mode-badge.live .mode-dot { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green-glow); }
.mode-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 0.82rem; font-weight: 600;
    border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #6366f1);
    color: #fff; box-shadow: 0 2px 12px var(--accent-blue-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-blue-glow); filter: brightness(1.1); }
.btn-secondary { background: var(--bg-glass); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-glass-hover); border-color: var(--border-hover); color: var(--text-primary); }
.btn-icon {
    width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm);
    background: var(--bg-glass); color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-glass-hover); color: var(--text-primary); border-color: var(--border-hover); }
.btn-icon.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* --- Stats Grid --- */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    display: flex; align-items: center; gap: 14px;
    padding: 20px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border-color);
    backdrop-filter: blur(16px); transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 46px; height: 46px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-total .stat-icon { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.stat-published .stat-icon { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.stat-review .stat-icon { background: rgba(234,179,8,0.12); color: var(--accent-yellow); }
.stat-rejected .stat-icon { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.stat-value { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-label { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* --- Toolbar --- */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-box {
    flex: 1; min-width: 280px; max-width: 520px;
    display: flex; align-items: center; gap: 10px;
    padding: 0 16px; height: 44px; border-radius: var(--radius-md);
    background: var(--bg-glass); border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font); font-size: 0.85rem;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-clear {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; display: flex; border-radius: 4px;
}
.search-clear:hover { color: var(--text-primary); background: var(--bg-glass-hover); }
.toolbar-info { display: flex; align-items: center; gap: 16px; }
.cron-status {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.75rem; color: var(--text-muted);
}
.app-count { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

/* --- Table --- */
.table-container {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); backdrop-filter: blur(16px);
    overflow: hidden;
}
.apps-table { width: 100%; border-collapse: collapse; }
.apps-table thead { background: rgba(255,255,255,0.02); }
.apps-table th {
    padding: 14px 16px; text-align: left;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.apps-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem; vertical-align: middle;
}
.apps-table tbody tr { transition: background var(--transition); }
.apps-table tbody tr:hover { background: var(--bg-glass-hover); }
.apps-table tbody tr:last-child td { border-bottom: none; }

.th-no { width: 50px; text-align: center; }
.td-no { text-align: center; color: var(--text-muted); font-weight: 500; }
.th-app { min-width: 180px; }
.td-app { font-weight: 600; color: var(--text-primary); }
.th-pkg { min-width: 200px; }
.td-pkg { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--text-secondary); }
.th-dev { min-width: 130px; }
.td-dev { color: var(--text-secondary); }
.th-status { width: 140px; }
.th-time { width: 160px; }
.td-time { font-size: 0.78rem; color: var(--text-muted); }
.th-actions { width: 130px; text-align: center; }
.td-actions { text-align: center; display: flex; gap: 6px; justify-content: center; }

/* --- Status Badges --- */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}
.status-badge .status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.status-completed { background: rgba(34,197,94,0.1); color: var(--accent-green); border: 1px solid rgba(34,197,94,0.2); }
.status-completed .status-dot { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green-glow); }

.status-inProgress { background: rgba(234,179,8,0.1); color: var(--accent-yellow); border: 1px solid rgba(234,179,8,0.2); }
.status-inProgress .status-dot { background: var(--accent-yellow); box-shadow: 0 0 6px var(--accent-yellow-glow); animation: pulse 1.5s infinite; }

.status-rejected { background: rgba(239,68,68,0.1); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.2); }
.status-rejected .status-dot { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red-glow); }

.status-draft { background: rgba(148,163,184,0.1); color: var(--text-secondary); border: 1px solid rgba(148,163,184,0.15); }
.status-draft .status-dot { background: var(--text-muted); }

.status-halted { background: rgba(249,115,22,0.1); color: var(--accent-orange); border: 1px solid rgba(249,115,22,0.2); }
.status-halted .status-dot { background: var(--accent-orange); }

.status-Unknown, .status-error, .status-not_found, .status-access_denied, .status-auth_error {
    background: rgba(100,116,139,0.1); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.15);
}
.status-Unknown .status-dot, .status-error .status-dot { background: var(--text-muted); }

/* --- Empty State --- */
.empty-state {
    padding: 60px 20px; text-align: center;
}
.empty-icon { color: var(--text-muted); margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg); animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border-color);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.btn-close {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.modal form { padding: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--bg-glass); border: 1px solid var(--border-color);
    color: var(--text-primary); font-family: var(--font); font-size: 0.88rem;
    outline: none; transition: all var(--transition);
}
.form-group input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
.form-group input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; display: block; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(10,14,26,0.85); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.loading-spinner {
    width: 44px; height: 44px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-overlay p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: var(--radius-md);
    font-size: 0.82rem; font-weight: 500;
    backdrop-filter: blur(16px); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md); animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
    max-width: 380px;
}
.toast-success { background: rgba(34,197,94,0.15); color: var(--accent-green); border-color: rgba(34,197,94,0.3); }
.toast-error { background: rgba(239,68,68,0.15); color: var(--accent-red); border-color: rgba(239,68,68,0.3); }
.toast-info { background: rgba(59,130,246,0.15); color: var(--accent-blue); border-color: rgba(59,130,246,0.3); }

@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* --- Login Screen --- */
.login-screen {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); padding: 40px 36px 32px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
    width: 64px; height: 64px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    color: #fff; margin: 0 auto 16px;
    box-shadow: 0 4px 24px var(--accent-blue-glow);
}
.login-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group input { width: 100%; }
.login-error {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
    color: var(--accent-red); font-size: 0.82rem; margin-bottom: 16px;
}
.btn-login {
    width: 100%; justify-content: center; padding: 12px;
    font-size: 0.9rem; margin-top: 8px;
}
.login-footer { text-align: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.login-footer p { font-size: 0.75rem; color: var(--text-muted); }

/* --- Logout Button --- */
.btn-logout { color: var(--text-muted); }
.btn-logout:hover { background: rgba(239,68,68,0.1); color: var(--accent-red); border-color: rgba(239,68,68,0.2); }

/* --- Footer --- */
.app-footer {
    margin-top: 48px;
    padding: 0 0 8px;
    text-align: center;
}
.footer-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), rgba(99, 102, 241, 0.25), var(--border-color), transparent);
    margin-bottom: 20px;
}
.footer-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}
.footer-author {
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Modal Large --- */
.modal.modal-lg {
    max-width: 700px;
    width: 95%;
}

/* --- Review Item Styles --- */
.review-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.review-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.review-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.review-rating-stars {
    display: flex;
    gap: 2px;
    color: var(--accent-yellow);
}

.review-rating-stars svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.review-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

/* --- Developer Reply Box --- */
.reply-container {
    background: rgba(59, 130, 246, 0.04);
    border-left: 3px solid var(--accent-blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 14px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.reply-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.reply-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    word-break: break-word;
}

/* --- Reply Form --- */
.reply-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.reply-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    resize: vertical;
    transition: var(--transition);
}

.reply-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .app-container { padding: 16px; }
    .header { flex-direction: column; align-items: flex-start; }
    .header-right { width: 100%; justify-content: flex-end; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.3rem; }
    .toolbar { flex-direction: column; }
    .search-box { min-width: auto; max-width: none; width: 100%; }
    .table-container { overflow-x: auto; }
    .apps-table { min-width: 700px; }
    .login-card { padding: 28px 20px 24px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .header-title { font-size: 1.2rem; }
}
