.ext-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:15px; }
.ext-search { flex:1; min-width:200px; padding:8px 12px; border:1px solid #ccc; border-radius:4px; font-size:14px; }
.ext-filter-btn { display:inline-block; padding:5px 12px; border:1px solid #ccc; border-radius:3px; background:#f5f5f5; color:#333; cursor:pointer; font-size:12px; text-decoration:none; }
.ext-filter-btn:hover, .ext-filter-btn.active { background:#0072bc; color:#fff; border-color:#0072bc; }
.ext-filter-btn .badge { display:inline-block; background:rgba(0,0,0,0.15); color:inherit; padding:1px 6px; border-radius:10px; font-size:11px; margin-left:4px; }
.ext-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:15px; margin-top:15px; }
.ext-card { border:1px solid #ddd; border-radius:6px; padding:16px; background:#fff; position:relative; transition:box-shadow .2s; display:flex; flex-direction:column; }
.ext-card:hover { box-shadow:0 2px 8px rgba(0,0,0,0.12); }
.ext-card-installed { background:#f0faf0; border-color:#c3e6c3; }
.ext-card-has-upgrade { background:#fdf8ec; border-color:#f0d78c; }
.ext-card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
.ext-card-name { font-size:14px; font-weight:700; color:#333; margin:0; line-height:1.3; }
.ext-card-version { font-size:11px; color:#888; white-space:nowrap; }
.ext-version-select { font-size:11px; padding:2px 4px; border:1px solid #ccc; border-radius:3px; background:#fff; color:#333; max-width:160px; }
.ext-card-desc { font-size:12px; color:#666; margin:0 0 8px; line-height:1.4; }
.ext-card-meta { display:flex; gap:8px; margin-bottom:0; padding-top:10px; flex-wrap:wrap; margin-top:auto; }
.ext-badge { display:inline-block; padding:2px 8px; border-radius:3px; font-size:11px; font-weight:600; text-transform:uppercase; }
.ext-badge-type { background:#e8f4fd; color:#0072bc; }
.ext-badge-cat { background:#f0f0f0; color:#666; }
.ext-badge-installed { background:#dff0d8; color:#3c763d; }
.ext-badge-upgrade { background:#fcf8e3; color:#8a6d3b; }
.ext-badge-thirdparty { background:#e8e0f0; color:#6a4c93; }
.ext-badge-official { background:#e3f2fd; color:#1565c0; }
.ext-badge-paid { background:#fff3cd; color:#856404; }
.ext-badge-ioncube { background:#fce4ec; color:#c62828; }
.ext-badge-php { background:#e8f5e9; color:#2e7d32; }
.ext-badge-php-incompatible { background:#ffebee; color:#c62828; }
.ext-btn-buy { background:#6f42c1; color:#fff; }
.ext-card-actions { display:flex; gap:6px; margin-top:0; padding-top:8px; flex-wrap:wrap; }
.ext-btn { display:inline-flex; align-items:center; gap:5px; padding:6px 10px; border:none; border-radius:4px; font-size:12px; font-weight:600; cursor:pointer; text-decoration:none; transition:opacity .2s; white-space:nowrap; }
.ext-btn:hover, a.ext-btn:hover { opacity:0.85; color:#fff; }
.ext-btn-disabled:hover { color:#666; }
.ext-btn-install { background:#5cb85c; color:#fff; }
.ext-btn-upgrade { background:#f0ad4e; color:#fff; }
.ext-btn-delete { background:#d9534f; color:#fff; }
.ext-btn-downgrade { background:#e67e22; color:#fff; }
.ext-btn-configure { background:#0072bc; color:#fff; }
.ext-btn-disabled { background:#ccc; color:#666; cursor:not-allowed; }
.ext-btn i { font-size:12px; color:#fff !important; }
.ext-btn-disabled i { color:#5cb85c !important; }
.ext-spinner { display:inline-block; width:12px; height:12px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:ext-spin .6s linear infinite; }
@keyframes ext-spin { to { transform:rotate(360deg); } }
.ext-toast { position:fixed; top:20px; right:20px; z-index:10000; padding:12px 20px; border-radius:6px; color:#fff; font-size:13px; font-weight:600; box-shadow:0 4px 12px rgba(0,0,0,.2); opacity:0; transform:translateY(-10px); transition:all .3s; pointer-events:none; }
.ext-toast.show { opacity:1; transform:translateY(0); pointer-events:auto; }
.ext-toast-success { background:#5cb85c; }
.ext-toast-error { background:#d9534f; }
.ext-empty { text-align:center; padding:40px; color:#999; font-size:14px; }
.ext-count { color:#888; font-size:13px; }
.ext-btn-gallery { background:#6c5ce7; color:#fff; }
.ext-recommended { color:#e8a317 !important; font-size:13px; cursor:default; }

/* Gallery modal */
.ext-gallery-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.8); z-index:10001; align-items:center; justify-content:center; }
.ext-gallery-overlay.show { display:flex; }
.ext-gallery-modal { background:#fff; border-radius:8px; max-width:900px; width:95vw; max-height:90vh; display:flex; flex-direction:column; overflow:hidden; }
.ext-gallery-header { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid #ddd; }
.ext-gallery-header h4 { margin:0; font-size:16px; font-weight:700; color:#333; }
.ext-gallery-close { background:none; border:none; font-size:18px; cursor:pointer; color:#666; padding:4px 8px; }
.ext-gallery-close:hover { color:#333; }
.ext-gallery-body { display:flex; align-items:center; position:relative; min-height:300px; flex:1; overflow:hidden; }
.ext-gallery-img-wrap { flex:1; display:flex; align-items:center; justify-content:center; padding:16px; overflow:hidden; }
.ext-gallery-img-wrap img { max-width:100%; max-height:60vh; object-fit:contain; border-radius:4px; }
.ext-gallery-nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(0,0,0,0.5); color:#fff; border:none; width:40px; height:40px; border-radius:50%; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; transition:background .2s; z-index:2; }
.ext-gallery-nav:hover { background:rgba(0,0,0,0.75); }
.ext-gallery-prev { left:10px; }
.ext-gallery-next { right:10px; }
.ext-gallery-footer { padding:10px 16px; border-top:1px solid #ddd; display:flex; align-items:center; gap:12px; }
.ext-gallery-footer span { font-size:12px; color:#888; white-space:nowrap; }
.ext-gallery-thumbs { display:flex; gap:6px; overflow-x:auto; flex:1; }
.ext-gallery-thumb { width:48px; height:48px; object-fit:cover; border-radius:4px; cursor:pointer; border:2px solid transparent; opacity:0.6; transition:opacity .2s, border-color .2s; }
.ext-gallery-thumb:hover { opacity:0.9; }
.ext-gallery-thumb.active { border-color:#0072bc; opacity:1; }

@media (prefers-color-scheme: dark) {
   .ext-search { background:var(--input-bg); border-color:var(--input-border); color:var(--text); }
   .ext-search:focus { background:var(--input-bg-focus); border-color:var(--input-border-focus); }
   .ext-search::placeholder { color:var(--text-muted); }
   .ext-filter-btn { background:var(--btn-bg); color:var(--btn-text); border-color:var(--btn-border); }
   .ext-filter-btn:hover, .ext-filter-btn.active { background:var(--primary); color:#fff; border-color:var(--primary-accent); }
   .ext-card { background:var(--panel); border-color:var(--border); }
   .ext-card:hover { box-shadow:0 2px 12px rgba(0,0,0,0.35); }
   .ext-card-installed { background:rgba(92,184,92,0.08); border-color:rgba(92,184,92,0.25); }
   .ext-card-has-upgrade { background:rgba(240,193,78,0.1); border-color:rgba(240,193,78,0.3); }
   .ext-card-name { color:var(--text); }
   .ext-card-version { color:var(--text-muted); }
   .ext-version-select { background:var(--input-bg); border-color:var(--input-border); color:var(--text); }
   .ext-card-desc { color:var(--text-muted); }
   .ext-badge-type { background:rgba(107,186,208,0.15); color:var(--primary-accent); }
   .ext-badge-cat { background:var(--panel-muted); color:var(--text-muted); }
   .ext-badge-installed { background:rgba(92,184,92,0.15); color:#8fd88f; }
   .ext-badge-upgrade { background:rgba(240,173,78,0.15); color:#f0c078; }
   .ext-badge-thirdparty { background:rgba(106,76,147,0.2); color:#c4a8e0; }
   .ext-badge-official { background:rgba(21,101,192,0.2); color:#90caf9; }
   .ext-badge-paid { background:rgba(133,100,4,0.2); color:#f0d078; }
   .ext-badge-ioncube { background:rgba(198,40,40,0.2); color:#ef9a9a; }
   .ext-badge-php { background:rgba(46,125,50,0.2); color:#a5d6a7; }
   .ext-badge-php-incompatible { background:rgba(198,40,40,0.2); color:#ef9a9a; }
   .ext-btn-buy { background:#5a32a8; }
   .ext-btn-install { background:#3a8c3a; }
   .ext-btn-upgrade { background:#b8862e; }
   .ext-btn-delete { background:#a83232; }
   .ext-btn-downgrade { background:#b5651d; }
   .ext-btn-configure { background:var(--primary); }
   .ext-btn-disabled { background:var(--btn-bg); color:var(--text-muted); }
   .ext-btn-disabled i { color:#5cb85c !important; }
   .ext-empty { color:var(--text-muted); }
   .ext-count { color:var(--text-muted); }
   .ext-toast { box-shadow:0 4px 16px rgba(0,0,0,0.5); }
   .ext-toast-success { background:#2d7a2d; }
   .ext-toast-error { background:#a83232; }
   .ext-btn-gallery { background:#5a4bd1; }
   .ext-gallery-modal { background:var(--panel); }
   .ext-gallery-header { border-color:var(--border); }
   .ext-gallery-header h4 { color:var(--text); }
   .ext-gallery-close { color:var(--text-muted); }
   .ext-gallery-close:hover { color:var(--text); }
   .ext-gallery-footer { border-color:var(--border); }
   .ext-gallery-footer span { color:var(--text-muted); }
   .ext-gallery-thumb.active { border-color:var(--primary-accent); }

}
