/* Tasker – Custom Styles
   Tailwind handles most utilities; this file adds:
   - Custom components (not expressible in Tailwind alone)
   - Animations
   - Input styles
   - Tool card styles
   - Scrollbar hiding
*/

/* ── Fonts are loaded via Google Fonts in layout.php ── */

/* ── Override Chrome autofill styling on search inputs ── */
#toolSearchNav:-webkit-autofill,
#toolSearchHero:-webkit-autofill,
#toolSearchNav:-webkit-autofill:hover,
#toolSearchHero:-webkit-autofill:hover,
#toolSearchNav:-webkit-autofill:focus,
#toolSearchHero:-webkit-autofill:focus {
    -webkit-text-fill-color: transparent !important;
    -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* ── Inputs ────────────────────────────────────────── */
.th-input {
    background-color: #111827;       /* gray-900 */
    border: 1px solid #374151;       /* gray-700 */
    border-radius: 0.75rem;          /* rounded-xl */
    padding: 0.625rem 0.875rem;
    color: #e5e7eb;                  /* gray-200 */
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.th-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.th-input::placeholder { color: #6b7280; }

textarea.th-input { resize: vertical; min-height: 120px; }

/* ── Buttons ────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #6366f1;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    font-family: inherit;
}
.btn-primary:hover { background-color: #4f46e5; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: transparent;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #374151;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    font-family: inherit;
}
.btn-secondary:hover { border-color: #6b7280; color: #e5e7eb; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc2626;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: inherit;
}
.btn-danger:hover { background-color: #b91c1c; }

/* ── Category tabs ──────────────────────────────────── */
.cat-tab {
    color: #9ca3af;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}
.cat-tab:hover { color: #e5e7eb; border-color: #374151; }
.cat-tab.active {
    background-color: #6366f1;
    color: #fff;
    border-color: transparent;
}

/* ── Tool Cards ─────────────────────────────────────── */
.tool-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tool-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.tool-card:active { transform: translateY(0); }

.tool-card.locked {
    opacity: 0.75;
}
.tool-card.locked:hover {
    border-color: #7c3aed;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

.tool-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background-color: #1f2937;
    color: #818cf8;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.tool-badge-public {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background-color: rgba(34, 197, 94, 0.1);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.tool-badge-login {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background-color: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ── Modals ─────────────────────────────────────────── */
.modal { pointer-events: none; }
.modal.open { pointer-events: all; }
.modal.open .modal-box {
    transform: scale(1);
    opacity: 1;
}

/* ── Toasts ─────────────────────────────────────────── */
.toast {
    pointer-events: all;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border: 1px solid transparent;
    animation: toastIn 0.3s ease forwards;
    max-width: 20rem;
}
.toast-success { background: #14532d; border-color: #15803d; color: #bbf7d0; }
.toast-error   { background: #450a0a; border-color: #991b1b; color: #fecaca; }
.toast-info    { background: #1e1b4b; border-color: #3730a3; color: #c7d2fe; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); max-height: 100px; margin-bottom: 0.5rem; }
    to   { opacity: 0; transform: translateX(100%); max-height: 0; margin-bottom: 0; padding: 0; }
}

/* ── Spinner ────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.7s linear infinite; }

/* ── Tool page layout ───────────────────────────────── */
.tool-page-header {
    border-bottom: 1px solid #1f2937;
    background: #0d1117;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.tool-page-back {
    color: #6b7280;
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.tool-page-back:hover { color: #e5e7eb; }

.tool-content-area {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ── Scrollbar hiding ───────────────────────────────── */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Animations ─────────────────────────────────────── */
.fade-in { animation: fadeIn 0.3s ease forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Code / Mono blocks ─────────────────────────────── */
.code-block {
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    min-height: 120px;
}

/* ── Stat cards (for word counter etc.) ─────────────── */
.stat-box {
    background: #1f2937;
    border-radius: 0.875rem;
    padding: 1rem;
    text-align: center;
}
.stat-box .stat-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: #818cf8;
    line-height: 1;
}
.stat-box .stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* ── Ad Containers (AdSense) ───────────────────────── */
.ad-container {
    width: 100%;
    overflow: hidden;
    text-align: center;
}
.ad-container ins {
    background: transparent;
}
.ad-banner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5rem 0;
}
.ad-in-feed {
    min-height: 100px;
}

/* In-feed ad card inside tool grid — match .tool-card sizing */
.ad-grid-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
.ad-grid-card .ad-in-feed {
    width: 100%;
}

/* ── Cookie Consent Banner ─────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: #111827;
    border-top: 1px solid #374151;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Account Modal – Danger Zone ───────────────────── */
.danger-zone {
    border: 1px solid #991b1b;
    border-radius: 0.75rem;
    padding: 1rem;
    background: rgba(127, 29, 29, 0.1);
}
