/**
 * WeegoSoft Tools — Shared Base Styles
 * Common utilities, scrollbars, and reusable components
 * used across all tool pages (works alongside TailwindCSS CDN).
 */

/* =============================================
   CUSTOM SCROLLBAR
   ============================================= */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* =============================================
   SIDEBAR COMMON STYLES
   ============================================= */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.sidebar-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* =============================================
   TOOL CARD ANIMATIONS
   ============================================= */
.tool-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* =============================================
   PROSE / MARKDOWN OUTPUT
   ============================================= */
.prose h1, .prose h2, .prose h3 {
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
}

.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.1rem; }

.prose p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 0.75em;
}

.prose ul, .prose ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75em;
}

.prose li {
    color: #475569;
    margin-bottom: 0.3em;
    line-height: 1.6;
}

.prose ul li { list-style-type: disc; }
.prose ol li { list-style-type: decimal; }

.prose strong { color: #1e293b; }
.prose em { color: #64748b; }

.prose code {
    background: #f1f5f9;
    color: #4f46e5;
    padding: 0.1em 0.4em;
    border-radius: 0.3em;
    font-size: 0.875em;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
}

.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin-bottom: 1em;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.prose blockquote {
    border-left: 3px solid #4f46e5;
    padding-left: 1rem;
    color: #64748b;
    font-style: italic;
    margin: 1em 0;
}

/* =============================================
   LOADING / SPINNER
   ============================================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* =============================================
   BUTTON BASE
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    outline: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* =============================================
   FORM INPUTS
   ============================================= */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #f8fafc;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background-color: white;
}

/* =============================================
   BADGES & TAGS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-indigo { background-color: #e0e7ff; color: #4338ca; }
.badge-pink   { background-color: #fce7f3; color: #be185d; }
.badge-amber  { background-color: #fef3c7; color: #92400e; }
.badge-green  { background-color: #dcfce7; color: #166534; }
.badge-slate  { background-color: #f1f5f9; color: #475569; }

/* =============================================
   TOAST / NOTIFICATION
   ============================================= */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from { transform: translateY(1rem); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.toast-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.toast-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.toast-info    { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
