/* NexaModz Frontend Styles */
.nm-app {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 8px 100px;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}
.nm-app * { box-sizing: border-box; }

/* Force-hide any [hidden] elements inside our widget (beats aggressive theme CSS) */
.nm-app [hidden] { display: none !important; }

/* Search */
.nm-search-wrap {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(241, 245, 249, 0.92);
    backdrop-filter: blur(8px);
    padding: 12px 8px 8px;
    margin: 0 -8px;
}
.nm-search { position: relative; }
.nm-search-icon {
    width: 16px; height: 16px;
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.nm-search-input {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 36px 10px 36px;
    font-size: 14px;
    color: #334155;
    outline: none;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.nm-search-input:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px #e0f2fe;
}
.nm-search-clear {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    font-size: 20px; line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    display: none;
}
.nm-search-clear:hover { color: #475569; background: #f1f5f9; }
.nm-app.has-query .nm-search-clear { display: block; }

/* Header */
.nm-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 12px 8px 8px;
    gap: 12px;
}
.nm-heading {
    font-size: 22px; font-weight: 800; margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.nm-brand { color: #0f172a; }
.nm-sep, .nm-active-label { color: #94a3b8; font-size: 15px; font-weight: 600; }
.nm-count { font-size: 13px; color: #64748b; margin: 4px 0 0; }
.nm-count-num { font-weight: 700; color: #334155; }

/* List container */
.nm-list-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.nm-list { list-style: none; margin: 0; padding: 0; }
.nm-empty { padding: 40px 20px; text-align: center; color: #94a3b8; font-size: 14px; }

/* Card */
.nm-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    transition: background-color .15s;
    position: relative;
}
.nm-card:last-child { border-bottom: none; }
.nm-card:hover { background: #f8fafc; }

.nm-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15,23,42,.06);
    margin-top: 2px;
}
.nm-icon.nm-icon-err { visibility: hidden; }
.nm-icon-placeholder {
    display: grid; place-items: center;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: #fff; font-weight: 800; font-size: 18px;
}

.nm-body { flex: 1; min-width: 0; }
.nm-name {
    font-size: 16px; font-weight: 700;
    color: #0284c7;
    margin: 0; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nm-author { font-size: 12px; color: #64748b; margin: 3px 0 0; }
.nm-author strong { color: #334155; font-weight: 700; }
.nm-badge {
    display: inline-block; margin-top: 5px;
    font-size: 10px; font-weight: 700;
    background: #fef3c7; color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 2px 8px;
}

/* Progress */
.nm-progress-wrap { margin-top: 8px; padding-right: 4px; }
.nm-progress-label {
    font-size: 12px; color: #334155; margin: 0 0 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nm-progress-label strong { color: #0f172a; font-weight: 800; }
.nm-progress-track {
    height: 8px; width: 100%;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.nm-progress-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    border-radius: 999px;
    position: relative; overflow: hidden;
    transition: width 90ms linear;
}
.nm-progress-shimmer {
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,.55) 50%,
        rgba(255,255,255,0) 100%);
    animation: nmShimmer 1.4s ease-in-out infinite;
}
@keyframes nmShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.nm-progress-meta {
    display: flex; justify-content: space-between;
    font-size: 10px; color: #94a3b8; margin-top: 4px;
}

/* Finalizing */
.nm-finalizing {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
    font-size: 12px; color: #0284c7; font-weight: 600;
}
.nm-spinner {
    width: 14px; height: 14px;
    border: 2px solid #e0f2fe;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: nmSpin .8s linear infinite;
}
@keyframes nmSpin { to { transform: rotate(360deg); } }

/* Button */
.nm-btn {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    display: inline-flex; align-items: center; gap: 6px;
    background: #0ea5e9;
    color: #fff;
    font-family: inherit; font-size: 13px; font-weight: 700;
    padding: 8px 14px;
    border: none; border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15,23,42,.08);
    transition: background-color .15s, transform .1s;
}
.nm-btn:hover { background: #0284c7; }
.nm-btn:active { transform: scale(.97); }
.nm-btn:disabled { opacity: .9; cursor: default; }
.nm-btn.is-done { background: #10b981; }
.nm-btn.is-done:hover { background: #059669; }
.nm-btn-icon { width: 16px; height: 16px; }
.nm-btn-icon-spin { animation: nmSpin .9s linear infinite; }

/* Bottom nav */
.nm-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(15,23,42,.04);
    display: grid; grid-template-columns: repeat(5, 1fr);
    max-width: 960px; margin: 0 auto;
}
.nm-nav-item {
    background: none; border: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px;
    color: #94a3b8;
    font-family: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer;
    transition: color .15s;
}
.nm-nav-item:hover { color: #475569; }
.nm-nav-item.is-active { color: #0ea5e9; }
.nm-nav-icon svg { width: 24px; height: 24px; stroke-width: 1.75; transition: transform .2s; }
.nm-nav-item.is-active .nm-nav-icon svg { stroke-width: 2.25; transform: scale(1.1); }

.nm-footer { text-align: center; color: #94a3b8; font-size: 11px; margin: 20px 0 8px; }

/* Responsive */
@media (max-width: 500px) {
    .nm-heading { font-size: 18px; }
    .nm-sep, .nm-active-label { font-size: 13px; }
    .nm-btn { font-size: 12px; padding: 7px 10px; }
    .nm-icon { width: 44px; height: 44px; }
    .nm-name { font-size: 15px; }
}
