/* ================================================================
   AnythingText Dashboard Styles — Dark Theme
   ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0f0b1a;
    color: #e2e8f0;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step circles (How It Works) */
.step-circle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* Drop zone active state */
.drop-zone-active {
    border-color: #6366f1 !important;
    background-color: #eef2ff !important;
}

/* Progress bar transition */
.progress-bar-animate {
    transition: width 0.4s ease;
}

/* Processing pulse border */
@keyframes pulse-border {
    0%, 100% { border-color: #6366f1; }
    50% { border-color: #a5b4fc; }
}
.processing-pulse {
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Record button pulse */
@keyframes record-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.record-pulse {
    animation: record-pulse 1.5s ease-in-out infinite;
}

/* ---- Textarea styling for light-themed tool panels ---- */
.bg-white textarea,
.bg-white .result-textarea {
    background-color: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 0.75rem;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bg-white textarea:focus,
.bg-white .result-textarea:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
    outline: none;
}
.bg-white textarea::placeholder {
    color: #94a3b8;
}

/* Custom scrollbar for textareas */
.result-textarea::-webkit-scrollbar { width: 6px; }
.result-textarea::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 3px; }
.result-textarea::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

/* Glassmorphism navbar */
.navbar-glass {
    background: rgba(15, 11, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

/* Hero gradient overlay */
.hero-bg {
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 20% 30%, rgba(79, 70, 229, 0.08) 0%, transparent 50%);
}

/* Search bar glow */
.search-glow {
    background: rgba(30, 27, 75, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}
.search-glow:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), 0 0 60px rgba(99, 102, 241, 0.05);
}
/* Override browser autofill background */
.search-glow input:-webkit-autofill,
.search-glow input:-webkit-autofill:hover,
.search-glow input:-webkit-autofill:focus,
.search-glow input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 50px rgba(30, 27, 75, 1) inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    transition: background-color 5000s ease-in-out 0s;
}

/* Feature card — dark glass */
.tool-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tool-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 40px rgba(99, 102, 241, 0.08);
}

/* Card top border colors */
.border-top-indigo { border-top: 3px solid #6366f1; }
.border-top-purple { border-top: 3px solid #8b5cf6; }
.border-top-pink { border-top: 3px solid #ec4899; }
.border-top-rose { border-top: 3px solid #f43f5e; }
.border-top-blue { border-top: 3px solid #3b82f6; }
.border-top-emerald { border-top: 3px solid #10b981; }
.border-top-amber { border-top: 3px solid #f59e0b; }
.border-top-teal { border-top: 3px solid #14b8a6; }
.border-top-green { border-top: 3px solid #10b981; }
.border-top-orange { border-top: 3px solid #f97316; }
.border-top-cyan { border-top: 3px solid #06b6d4; }
.border-top-sky { border-top: 3px solid #0ea5e9; }
.border-top-red { border-top: 3px solid #ef4444; }
.border-top-violet { border-top: 3px solid #8b5cf6; }
.border-top-fuchsia { border-top: 3px solid #d946ef; }
.border-top-lime { border-top: 3px solid #84cc16; }
.border-top-gray { border-top: 3px solid #4b5563; }
.border-top-slate { border-top: 3px solid #64748b; }
.border-top-zinc { border-top: 3px solid #71717a; }
.border-top-yellow { border-top: 3px solid #eab308; }

/* Footer */
.footer-bg {
    background: rgba(15, 11, 26, 0.95);
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}

/* User dropdown — dark */
.dropdown-dark {
    background: rgba(30, 27, 75, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Mobile menu slide-down */
.mobile-menu-enter { animation: slideDown 0.2s ease-out; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pin button on tool cards */
.pin-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
}
.tool-card:hover .pin-btn {
    opacity: 1;
}
.pin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}
.pin-btn.pinned {
    opacity: 1;
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    transform: rotate(-45deg);
}
.pin-btn.pinned:hover {
    background: rgba(250, 204, 21, 0.2);
    color: #fde047;
}

/* Pinned card indicator */
.tool-card.is-pinned {
    border-color: rgba(250, 204, 21, 0.2);
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.05);
}

/* Pinned / unpinned separator */
.pinned-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    grid-column: 1 / -1;
}
.pinned-separator .sep-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.25), transparent);
}
.pinned-separator .sep-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(250, 204, 21, 0.5);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* ---- Sort & Group Toolbar ---- */
.toolbar-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}
.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: rgba(255, 255, 255, 0.9);
}
.toolbar-btn-active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #818cf8 !important;
}

/* Sort dropdown active item */
.sort-active {
    color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.08);
}

/* ---- Group Headers ---- */
.group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 8px;
    grid-column: 1 / -1;
}
.group-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
}
.group-header-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}
.group-header-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    background: rgba(99, 102, 241, 0.15);
    color: rgba(99, 102, 241, 0.7);
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    padding: 0 6px;
    margin-left: 8px;
}

/* Docs "?" button on tool cards */
.docs-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
    text-decoration: none;
    font-family: 'Inter', system-ui, sans-serif;
}
.tool-card:hover .docs-btn {
    opacity: 1;
}
.docs-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    transform: scale(1.15);
}

/* Client-side tool badge - small "Free" label (lower-right) */
.client-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    z-index: 2;
}
.tool-card:hover .client-badge {
    opacity: 1;
    transform: scale(1.05);
}

/* ---- File Drop Zone on Tool Cards ---- */
.tool-card .drop-hint {
    margin-top: 8px;
    padding: 4px 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.12);
    text-align: center;
    transition: all 0.3s ease;
    pointer-events: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.tool-card:hover .drop-hint {
    color: rgba(245, 158, 11, 0.4);
    border-top-color: rgba(245, 158, 11, 0.15);
}
.tool-card.drag-over {
    border: 2px dashed rgba(245, 158, 11, 0.7) !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.15), inset 0 0 30px rgba(245, 158, 11, 0.05) !important;
    background: rgba(245, 158, 11, 0.04) !important;
    transform: translateY(-4px) scale(1.01);
}
.tool-card.drag-over .drop-hint {
    color: rgba(245, 158, 11, 0.9);
    font-weight: 600;
    border-top-color: rgba(245, 158, 11, 0.3);
}
.tool-card .drop-toast {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    font-weight: 700;
    font-size: 13px;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}
.tool-card .drop-toast.show { opacity: 1; }

/* SPA view hidden utility */
.view-hidden { display: none !important; }
