/* ═══════════════════════════════════════════════
   NeoGen Design System — Components
   .card, .modal, .btn, .form-*, .badge, .table,
   neo-character, neo-bubble, utilities
   ═══════════════════════════════════════════════ */

/* ── Cards ───────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 0 0 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3, .card > h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(6,182,212,0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    justify-content: center;
}

/* ── Forms ───────────────────────────────────── */
form { padding: 0; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-subtle);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--neo-cyan);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* ── Tables ──────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 13px;
}

th, td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(6,182,212,0.06);
    font-weight: 600;
    font-size: 12px;
    color: var(--neo-cyan);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ── Modals ──────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    margin: 4% auto;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.close:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* ── Neo Character ───────────────────────────── */
.neo-character {
    width: 72px;
    height: 72px;
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: neoFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 16px rgba(6,182,212,0.4));
}

.neo-character:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 6px 24px rgba(6,182,212,0.7));
}

.neo-character.analyzing {
    animation: neoAnalyzing 0.8s ease-in-out infinite;
}

/* ── Neo Bubble ──────────────────────────────── */
.neo-bubble {
    position: fixed;
    bottom: 112px;
    right: 24px;
    background: var(--neo-navy);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    max-width: 260px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(6,182,212,0.3);
    z-index: 999;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.neo-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.neo-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 26px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--neo-navy);
}

/* Smart Input - Neo */
.smart-neo {
    width: 180px;
    height: 180px;
    margin: 20px auto;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    filter: drop-shadow(0 8px 24px rgba(6,182,212,0.4));
}

.smart-neo.show {
    opacity: 1;
    transform: scale(1);
}

/* ── Neo Search Suggestions ──────────────────── */
.neo-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.suggestion-item {
    padding: 11px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--bg-subtle);
    transition: background 0.15s, color 0.15s;
}

.suggestion-item:hover {
    background: var(--bg-subtle);
    color: var(--neo-blue);
}

.suggestion-item:last-child { border-bottom: none; }

/* ── AI Performance Badge ────────────────────── */
.ai-performance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--green), #059669);
    color: white;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ── Export Buttons ──────────────────────────── */
.export-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Utilities ───────────────────────────────── */
.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    font-size: 13px;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }

/* ── Responsive — components ─────────────────── */
@media (max-width: 768px) {
    .modal-content { width: 95%; margin: 8px auto; }

    .neo-character { width: 58px; height: 58px; bottom: 20px; right: 20px; }
    .neo-bubble    { bottom: 88px; right: 16px; max-width: 220px; }
    .smart-neo     { width: 140px; height: 140px; }
}
