/* ===========================================
   AI Tools Theme Integration - Standalone CSS
   Works with ANY theme. All styles scoped to
   .ait-injected to prevent conflicts.
   =========================================== */

/* ─── Reset inside injected sections ─── */
.ait-injected,
.ait-injected *,
.ait-injected *::before,
.ait-injected *::after {
    box-sizing: border-box;
}

.ait-injected {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ─── Visit Website Button ─── */
.pure-hero .ait-visit-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 18px !important;
    background: #2563eb !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.pure-hero .ait-visit-btn:hover {
    background: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}



/* ─── Editor's Pick Badge ─── */
.pure-hero .ait-editor-pick {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    color: #92400e !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 6px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    border-bottom: 1px solid rgba(0,0,0,0.06) !important;
}

/* ─── Copy Link Success State ─── */
.ait-injected .share-btn .fa-check {
    color: #10b981 !important;
}

/* ─── Section Headers ─── */
.ait-injected .ait-section-header {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    border: none !important;
    background: none !important;
}

/* ─── Features Section ─── */
.ait-injected .features-section {
    margin: 28px 0;
}

.ait-injected .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.ait-injected .feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ait-injected .feature-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.ait-injected .feature-item i {
    color: #2563eb;
    font-size: 1rem;
    flex-shrink: 0;
}

.ait-injected .feature-item span {
    line-height: 1.4;
}

/* ─── Pros & Cons ─── */
.ait-injected .pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 28px 0;
}

.ait-injected .pc-box {
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.ait-injected .pc-box.pros {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ait-injected .pc-box.cons {
    background: #fef2f2;
    border-color: #fecaca;
}

.ait-injected .pc-box h2 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.ait-injected .pc-box.pros h2 { color: #166534 !important; }
.ait-injected .pc-box.cons h2 { color: #991b1b !important; }

.ait-injected .pc-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ait-injected .pc-list li {
    padding: 6px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
    color: #334155;
}

.ait-injected .pc-list li i {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ─── Expert Opinion ─── */
.ait-injected .expert-opinion {
    margin: 28px 0;
    padding: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.ait-injected .expert-opinion h2 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1e40af !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.ait-injected .expert-opinion p {
    font-size: 1rem;
    color: #334155;
    line-height: 1.7;
    margin: 0;
    font-style: italic;
}

/* ─── Download Grid ─── */
.ait-injected .download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 0 0 28px;
}

.ait-injected .dl-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none !important;
    color: #1e293b !important;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ait-injected .dl-button:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
    transform: translateY(-2px);
}

.ait-injected .dl-button span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ait-injected .dl-button i {
    font-size: 1.1rem;
    color: #64748b;
}

.ait-injected .dl-button:hover i {
    color: #2563eb;
}

/* ─── Share Buttons ─── */
.ait-injected .ait-share {
    margin: 40px 0 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    background: #ffffff !important;
    padding: 20px 30px !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.ait-injected .ait-share .share-title {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 1.05rem !important;
}

.ait-injected .ait-share .share-buttons {
    display: flex !important;
    gap: 10px !important;
}

.ait-injected .ait-share-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #64748b !important;
    text-decoration: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.ait-injected .ait-share-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.ait-injected .ait-share-btn.ait-facebook { background: #1877f2 !important; color: #fff !important; border-color: #1877f2 !important; }
.ait-injected .ait-share-btn.ait-twitter  { background: #000 !important; color: #fff !important; border-color: #000 !important; }
.ait-injected .ait-share-btn.ait-whatsapp { background: #25D366 !important; color: #fff !important; border-color: #25D366 !important; }
.ait-injected .ait-share-btn.ait-telegram { background: #0088cc !important; color: #fff !important; border-color: #0088cc !important; }
.ait-injected .ait-share-btn.ait-copy-link { background: #6366f1 !important; color: #fff !important; border-color: #6366f1 !important; }

/* ─── Similar Tools Section ─── */
.ait-injected .similar-tools-section {
    margin: 40px 0 20px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .ait-injected .pros-cons {
        grid-template-columns: 1fr;
    }
    .ait-injected .download-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ait-injected .features-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   REDIRECT TIMER MODAL
   ========================================= */
.redirect-timer-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.redirect-timer-modal-v6 {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 28px 0;
    max-width: 460px;
    width: 94%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    overflow: hidden;
    animation: v6Slide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.v6-left { flex-shrink: 0; padding-bottom: 28px; }
.v6-ring {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.v6-ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.v6-ring .bg { fill: none; stroke: #f1f5f9; stroke-width: 4; }
.v6-ring .fg { fill: none; stroke: #2563eb; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.v6-count { font-size: 1.6rem; font-weight: 800; color: #1e293b; line-height: 1; }

.v6-right { flex: 1; min-width: 0; padding-top: 4px; padding-bottom: 28px; }
.v6-label { font-size: 0.72rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 4px; }
.v6-title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0 0 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v6-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.v6-btn {
    background: #2563eb; color: #fff; border: none; padding: 10px 20px;
    border-radius: 10px; font-weight: 600; font-size: 0.88rem;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: background 0.2s, transform 0.2s; opacity: 0; transform: translateY(6px);
}
.v6-btn.active { opacity: 1; transform: translateY(0); }
.v6-btn:hover { background: #1d4ed8; transform: translateY(-1px); }

.v6-fallback-link { font-size: 0.78rem; color: #64748b; text-decoration: none; border-bottom: 1px dashed #cbd5e1; transition: color 0.2s; white-space: nowrap; }
.v6-fallback-link:hover { color: #2563eb; }

.v6-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: #cbd5e1; font-size: 1rem; cursor: pointer; padding: 4px; line-height: 1; transition: color 0.2s; display: flex; align-items: center; justify-content: center; }
.v6-close:hover { color: #ef4444; }

.v6-progress-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #f1f5f9; }
.v6-progress-fill { height: 100%; width: 0; background: #2563eb; border-radius: 0 2px 2px 0; transition: width 1s linear; }

@media (max-width: 480px) {
    .redirect-timer-modal-v6 { flex-direction: column; align-items: center; text-align: center; padding: 24px 24px 0; gap: 12px; }
    .v6-title { white-space: normal; }
    .v6-actions { align-items: center; width: 100%; }
    .v6-btn { width: 100%; justify-content: center; }
}

/* =========================================
   INLINE DOWNLOAD TIMER
   ========================================= */
.dl-button.is-timer-active {
    pointer-events: none;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    padding: 8px 12px !important;
    min-height: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

.inline-timer-container { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; }
.inline-timer-visual { position: relative; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inline-timer-visual svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.inline-timer-visual .bg { fill: none; stroke: #f1f5f9; stroke-width: 3; }
.inline-timer-visual .fg { fill: none; stroke: #2563eb; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.inline-count { font-size: 0.85rem; font-weight: 700; color: #2563eb; margin-bottom: 0 !important; display: flex; align-items: center; justify-content: center; }
.inline-label { font-size: 0.85rem; font-weight: 600; color: #475569; flex-grow: 1; text-align: left; }

.inline-back-btn { background: #f1f5f9; border: none; color: #64748b; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; padding: 0; line-height: 1; }
.inline-back-btn:hover { background: #fee2e2; color: #ef4444; }

.dl-button.is-timer-complete { background: #10b981 !important; color: white !important; border-color: #059669 !important; }

/* ─── Archive/Loop Injection ─── */
.ait-loop-actions {
    margin-top: 15px !important;
    display: block !important;
}

.ait-loop-visit-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: none !important;
    line-height: 1 !important;
}

.ait-loop-visit-btn:hover {
    background-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
    color: #ffffff !important;
}

/* ─── Archive Theme Compatibility (Light Mode) ─── */
.ai-archive-wrap.ait-theme-compat {
    background: #f8fafc !important;
    color: #1e293b !important;
}

.ai-archive-wrap.ait-theme-compat .ai-archive-hero {
    background: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-archive-hero h1 {
    color: #0f172a !important;
}

.ai-archive-wrap.ait-theme-compat .hero-desc {
    color: #475569 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-archive-search input {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filter-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filter-btn:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
}

.ai-archive-wrap.ait-theme-compat .ai-archive-sidebar .ai-sidebar-widget {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

.ai-archive-wrap.ait-theme-compat .widget-header {
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-mv-item {
    border-bottom: 1px solid #f1f5f9 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-mv-name {
    color: #1e293b !important;
}

.ai-archive-wrap.ait-theme-compat .ai-cat-list-item {
    background: #f8fafc !important;
    color: #475569 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-cat-list-item:hover {
    background: #f1f5f9 !important;
    color: #2563eb !important;
}

.ai-archive-wrap.ait-theme-compat .ai-subcat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-subcat-card h3 {
    color: #0f172a !important;
}

.ai-archive-wrap.ait-theme-compat .tool-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}

.ai-archive-wrap.ait-theme-compat .tool-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08) !important;
    border-color: #2563eb !important;
}

.ai-archive-wrap.ait-theme-compat .tool-card .tool-name {
    color: #0f172a !important;
}

.ai-archive-wrap.ait-theme-compat .tool-card .tool-desc {
    color: #475569 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filters-bar-v2 {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filter-dropdown-v2 {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filter-opt {
    color: #1e293b !important;
}

.ai-archive-wrap.ait-theme-compat .ai-filter-opt:hover {
    background: #f8fafc !important;
}
