/* ═══════════════════════════════════════════════════════════════════════════
   FONTS COPY & PASTE — Custom Styles
   Extends Tailwind CSS v3 with premium design effects.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    --font-preview-size: 18px;
    --toast-duration: 2.5s;
    --card-radius: 14px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.dark {
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ─── Smooth Transitions ─────────────────────────────────────────────────── */
*, *::before, *::after {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Body Background ────────────────────────────────────────────────────── */
body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.06) 0%, transparent 50%);
}

.dark body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
}

/* ─── Glassmorphism Card ─────────────────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.dark .glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ─── Font Card ──────────────────────────────────────────────────────────── */
.font-card {
    position: relative;
    padding: 1rem 1.25rem;
    cursor: pointer;
    overflow: hidden;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.font-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.font-card:hover::before {
    opacity: 1;
}

.font-card__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    transition: color 0.2s;
}

.dark .font-card__label {
    color: #64748b;
}

.font-card__preview {
    font-size: var(--font-preview-size);
    line-height: 1.5;
    word-break: break-word;
    color: #1e293b;
    user-select: all;
}

.dark .font-card__preview {
    color: #e2e8f0;
}

.font-card__actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.font-card:hover .font-card__actions {
    opacity: 1;
    transform: translateY(0);
}

/* On mobile, always show actions */
@media (max-width: 768px) {
    .font-card__actions {
        opacity: 1;
        transform: translateY(0);
    }
}

.font-card__btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    transition: all 0.2s ease;
}

.font-card__btn:hover {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.font-card__btn--fav.active {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

.font-card__btn--fav.active svg {
    fill: #f43f5e;
}

/* ─── Copy Flash Animation ───────────────────────────────────────────────── */
.font-card--copied {
    animation: copyFlash 0.5s ease;
}

@keyframes copyFlash {
    0% { box-shadow: var(--glass-shadow); }
    30% { box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.4), var(--glass-shadow); }
    100% { box-shadow: var(--glass-shadow); }
}

/* ─── Category Filter Chips ──────────────────────────────────────────────── */
.filter-chip {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
}

.dark .filter-chip {
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
}

.filter-chip:hover {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.3);
}

.filter-chip.active {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

/* ─── Toast Notification ─────────────────────────────────────────────────── */
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1),
               toastSlideOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) var(--toast-duration) forwards;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.35);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-16px) scale(0.95); }
}

/* ─── Input Field ────────────────────────────────────────────────────────── */
.input-glow:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2), 0 4px 20px rgba(6, 182, 212, 0.1);
}

/* ─── Preview Size Slider ────────────────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.2);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

/* ─── Scroll to Top ──────────────────────────────────────────────────────── */
#scrollTopBtn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ─── Custom Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* ─── Favorites Section ──────────────────────────────────────────────────── */
.favorites-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.favorites-header__icon {
    color: #f43f5e;
}

/* ─── SEO Content Section ────────────────────────────────────────────────── */
.seo-content {
    line-height: 1.8;
}

.seo-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.dark .seo-content h2 {
    color: #f1f5f9;
}

.seo-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.seo-content p {
    margin-bottom: 1rem;
    color: #475569;
}

.dark .seo-content p {
    color: #94a3b8;
}

.seo-content a {
    color: #06b6d4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.seo-content a:hover {
    color: #0891b2;
}

.seo-content ul, .seo-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.4rem;
    color: #475569;
}

.dark .seo-content li {
    color: #94a3b8;
}

/* ─── FAQ Accordion ──────────────────────────────────────────────────────── */
.faq-item {
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.faq-question {
    width: 100%;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    background: transparent;
    border: none;
    color: inherit;
}

.faq-question__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-question__icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 1.25rem;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 1.25rem 1rem;
}

/* ─── Hero Gradient Text ─────────────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #06b6d4, #14b8a6, #06b6d4);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* ─── Loading Skeleton ───────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(148, 163, 184, 0.1) 25%, 
        rgba(148, 163, 184, 0.2) 50%, 
        rgba(148, 163, 184, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Hide Scrollbar Utility ─────────────────────────────────────────────── */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Ad Slot Placeholder ────────────────────────────────────────────────── */
.ad-slot {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.04);
    border: 1px dashed rgba(148, 163, 184, 0.15);
    color: rgba(148, 163, 184, 0.3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
