/* ==========================================================
   front-page.css — Stage 8 (extracted from front-page.php)
   CSS variables (--primary, --primary-dark, etc.) are injected
   globally by functions.php via toolnexus_output_dynamic_css().
   ========================================================== */

/* Global reset + base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 40px; }

/* ============================================
   TWO COLUMN LAYOUT
============================================ */
.two-columns { display: flex; gap: 32px; flex-wrap: wrap; margin: 48px 0 60px; align-items: flex-start; }
.main-tools { flex: 1; min-width: 0; width: 75%; }
.sidebar { width: 25%; min-width: 280px; }

/* ============================================
   CATEGORY HEADER
============================================ */
.category-section { margin-bottom: 48px; }
.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    min-height: 44px;
}
.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 19px;
    box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.25);
    flex-shrink: 0;
    line-height: 1;
}
.category-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
    display: flex;
    align-items: center;
}

/* ============================================
   TOOLS GRID
============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ============================================
   TOOL CARD
============================================ */
.tool-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 22px 20px 18px;
    box-shadow: 0 10px 30px rgba(15,30,70,.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    contain: layout style paint;
    cursor: pointer;
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 44px rgba(15,30,70,.13);
}
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.tool-card.tint-red::before { background: linear-gradient(180deg, #fff3f4 0%, #fff 62%); }
.tool-card.tint-blue::before { background: linear-gradient(180deg, #eef3ff 0%, #fff 62%); }
.tool-card.tint-green::before { background: linear-gradient(180deg, #e9fbf1 0%, #fff 62%); }
.tool-card.tint-orange::before { background: linear-gradient(180deg, #fff4e6 0%, #fff 62%); }
.tool-card.tint-purple::before { background: linear-gradient(180deg, #f6efff 0%, #fff 62%); }
.tool-card.tint-yellow::before { background: linear-gradient(180deg, #fffae8 0%, #fff 62%); }
.tool-card.tint-pink::before { background: linear-gradient(180deg, #fdf2f8 0%, #fff 62%); }
.tool-card.tint-teal::before { background: linear-gradient(180deg, #f0fdfa 0%, #fff 62%); }

.tool-card > * { position: relative; z-index: 1; }

.tool-card .wm {
    position: absolute;
    top: 12px; left: 14px;
    z-index: 0;
    opacity: .10;
    pointer-events: none;
}
.tool-card .wm i { font-size: 68px; line-height: 1; }
.tool-card.tint-red .wm i { color: #ef2d3a; }
.tool-card.tint-blue .wm i { color: #3b6ef0; }
.tool-card.tint-green .wm i { color: #0e9f6e; }
.tool-card.tint-orange .wm i { color: #fe8f19; }
.tool-card.tint-purple .wm i { color: #7c3aed; }
.tool-card.tint-yellow .wm i { color: #f59e0b; }
.tool-card.tint-pink .wm i { color: #ec4899; }
.tool-card.tint-teal .wm i { color: #14b8a6; }

.tool-card .ribbon {
    position: absolute;
    top: 0; left: 0;
    z-index: 3;
    width: 42px; height: 52px;
    background: linear-gradient(180deg, #ffd23f, #f5b301);
    clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #7a4d00;
    font-weight: 800;
    font-size: 14px;
    padding-top: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.tool-card .badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 999px;
    line-height: 1;
    letter-spacing: -.1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.tool-card .badge i { font-size: 11px; line-height: 1; }
.tool-card .badge.trending { background: #e7f8ef; color: #0c9a6c; border: 1px solid #c9ecd9; }
.tool-card .badge.trending i { color: #0c9a6c; }
.tool-card .badge.popular { background: #fdeaea; color: #e0242e; border: 1px solid #f8cfcf; }
.tool-card .badge.popular i { color: #ff5a1f; }

.tool-card-body {
    display: flex;
    gap: 14px;
    margin-top: 30px;
    align-items: flex-start;
}

.tool-icon-box {
    width: 58px; height: 58px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.tool-icon-box i { font-size: 26px; }
.tool-icon-box.red    { background: linear-gradient(145deg, #ff4d5e, #e11d2e); }
.tool-icon-box.blue   { background: linear-gradient(145deg, #5b8cff, #2f5be0); }
.tool-icon-box.green  { background: linear-gradient(145deg, #22c55e, #0e9f6e); }
.tool-icon-box.orange { background: linear-gradient(145deg, #ffa53d, #fb7a0a); }
.tool-icon-box.purple { background: linear-gradient(145deg, #a855f7, #7c3aed); }
.tool-icon-box.yellow { background: linear-gradient(145deg, #fbbf24, #f59e0b); }
.tool-icon-box.pink   { background: linear-gradient(145deg, #ec4899, #f43f5e); }
.tool-icon-box.teal   { background: linear-gradient(145deg, #14b8a6, #0d9488); }

.tool-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.2px;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    align-self: center;
}
.tool-card:hover .tool-title { color: var(--primary); }

.tool-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
}
.tool-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--star);
    flex-shrink: 0;
}
.tool-rating i { font-size: 14px; color: var(--star); }
.tool-rating-value { color: var(--text-dark); font-weight: 800; }
.tool-rating-count { color: var(--text-muted); font-weight: 600; font-size: 12px; }
.tool-usage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2c3e5e;
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.tool-usage i { font-size: 15px; color: #2c3e5e; line-height: 1; }
.tool-usage-count { color: #2c3e5e; font-weight: 700; font-size: 13.5px; }
.tool-usage-count.usage-updated { animation: toolUsagePulse .45s ease; }
@keyframes toolUsagePulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    align-items: stretch;
    width: 100%;
}

.tool-share-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #fff;
    border: 1.5px solid #e6eaf3;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 13.5px;
    padding: 11px 8px;
    border-radius: 11px;
    transition: background-color .2s, border-color .2s;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
}
.tool-share-btn i { font-size: 14px; color: #7c3aed; }
.tool-share-btn:hover { background: #f6f2ff; border-color: #d9c8fb; }

.tool-button {
    flex: 1.35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: #fff !important;
    border: none;
    font-weight: 800;
    font-size: 13.5px;
    padding: 11px 8px;
    border-radius: 11px;
    box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.32);
    transition: filter .2s;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
}
.tool-button i { font-size: 13px; color: #fff; }
.tool-button:hover { filter: brightness(1.07); color: #fff !important; }
.tool-button:active { transform: scale(.97); }

/* ============================================
   SIDEBAR
============================================ */
.sidebar-widget {
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.widget-title {
    font-size: 1.05rem; font-weight: 800;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 10px;
    color: var(--text-dark);
}
.widget-title i { color: var(--primary); }
.popular-list, .recent-list { list-style: none; }
.popular-list li, .recent-list li {
    padding: 11px 0;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 12px;
    font-size: 0.85rem; color: var(--text-dark);
}
.popular-list li:last-child, .recent-list li:last-child { border-bottom: none; }
.popular-list li a, .recent-list li a {
    color: var(--text-dark); text-decoration: none; flex: 1;
    transition: color 0.2s; font-weight: 600;
}
.popular-list li a:hover, .recent-list li a:hover { color: var(--primary); }
.popular-list li i, .recent-list li i { color: var(--primary); font-size: 14px; }

/* ============================================
   CATEGORY LIST (SIDEBAR)
============================================ */
.category-list-modern { list-style: none; display: grid; gap: 8px; }
.category-list-modern li a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px;
    background: #f4effa;
    border-radius: 12px;
    text-decoration: none;
    color: #2d1b4e;
    font-size: 0.9rem; font-weight: 700;
    transition: all 0.2s ease;
}
.category-list-modern li a:hover {
    background: var(--primary);
    color: #fff !important;
    transform: translateX(4px);
    text-decoration: none !important;
}
.category-list-modern .cat-name-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.category-list-modern .cat-name-wrap i {
    font-size: 1.1rem;
    color: #2d1b4e;
    transition: color 0.2s ease;
}
.category-list-modern li a:hover .cat-name-wrap i { color: #fff !important; }

/* ============================================
   PLATFORM STATS (SIDEBAR)
============================================ */
.platform-stats-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.platform-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px dashed #d1d5db;
}
.platform-stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.platform-stat-label {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
}
.platform-stat-label i {
    font-size: 1.15rem;
    color: #8b5cf6;
    width: 24px;
    text-align: center;
}
.platform-stat-value {
    background: #f3e8ff;
    color: #6d28d9;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1400px) { .app-container { padding: 0 30px; } }
@media (max-width: 1200px) {
    .app-container { padding: 0 24px; }
    .tools-grid { gap: 18px; }
    .tool-icon-box { width: 54px; height: 54px; }
    .tool-icon-box i { font-size: 24px; }
    .tool-title { font-size: 15px; }
}
@media (max-width: 1024px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .two-columns { flex-direction: column; gap: 40px; }
    .main-tools, .sidebar { width: 100%; }
    .category-header h2 { font-size: 1.35rem; }
}
@media (max-width: 768px) {
    .app-container { padding: 0 20px; }
    .two-columns { margin: 32px 0 40px; gap: 32px; }
    .tools-grid { gap: 16px; }
    .category-section { margin-bottom: 40px; }
    .tool-card { padding: 18px 16px 14px; }
    .tool-card-body { margin-top: 38px; }
    .tool-icon-box { width: 48px; height: 48px; border-radius: 14px; }
    .tool-icon-box i { font-size: 22px; }
    .tool-title { font-size: 14.5px; }
    .tool-description { font-size: 12px; }
    .tool-button, .tool-share-btn { font-size: 12.5px; padding: 10px 6px; }
    .tool-card .badge { font-size: 11px; padding: 5px 10px; }
    .tool-card .badge i { font-size: 10px; }
    .category-icon { width: 40px; height: 40px; font-size: 17px; }
    .category-header h2 { font-size: 1.25rem; }
}
@media (max-width: 576px) {
    .app-container { padding: 0 16px; }
    .tools-grid { grid-template-columns: 1fr; }
    .category-header { margin-bottom: 18px; min-height: 40px; }
    .category-icon { width: 38px; height: 38px; font-size: 16px; }
    .category-header h2 { font-size: 1.15rem; }
    .tool-card { padding: 16px 14px 12px; }
    .tool-card-body { margin-top: 36px; gap: 10px; }
    .tool-icon-box { width: 44px; height: 44px; border-radius: 13px; }
    .tool-icon-box i { font-size: 20px; }
    .tool-title { font-size: 14px; }
    .tool-description { font-size: 11.5px; }
}
@media (max-width: 420px) {
    .app-container { padding: 0 12px; }
    .tool-card { padding: 14px 12px 10px; }
    .tool-icon-box { width: 40px; height: 40px; }
    .tool-icon-box i { font-size: 18px; }
    .tool-title { font-size: 13.5px; }
    .tool-description { font-size: 11px; }
    .tool-button, .tool-share-btn { font-size: 11.5px; }
}

/* ============================================
   SHARE MODAL — STAGE 8 FIX
============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 45, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: 22px;
    max-width: 470px;
    width: 100%;
    padding: 30px 28px 26px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
    animation: modalPop .28s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes modalPop {
    from { transform: scale(.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal .close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s;
    cursor: pointer;
}
.modal .close:hover { background: #f1f4fa; }
.modal .close svg { width: 18px; height: 18px; stroke: var(--text-dark); }

.modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}
.modal-head .rocket {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #f3e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-head .rocket svg { width: 30px; height: 30px; }
.modal-head h3 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--text-dark);
    margin: 0;
}
.modal-head p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 500;
}

.socials-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 22px 0 20px;
}
.soc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.soc .bubble {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s;
    cursor: pointer;
    border: none;
    padding: 0;
}
.soc:hover .bubble { transform: translateY(-4px); }
.soc .bubble svg { width: 24px; height: 24px; fill: #fff; }
.soc span {
    font-size: 10.5px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: center;
}
.b-fb { background: #1877f2; }
.b-x { background: #111; }
.b-wa { background: #25d366; }
.b-in { background: #0a66c2; }
.b-pin { background: #e60023; }
.b-link { background: #eef1f6; }
.b-link svg { fill: #5b6478 !important; }

.copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f6fb;
    border: 1px solid #e6eaf3;
    border-radius: 12px;
    padding: 8px 8px 8px 14px;
}
.copy-row svg {
    width: 17px;
    height: 17px;
    stroke: var(--text-muted);
    flex-shrink: 0;
    fill: none;
}
.copy-row input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-dark);
    font-weight: 600;
    min-width: 0;
}
.btn-copy {
    background: linear-gradient(180deg, #12a877, #0b8a5f);
    color: #fff;
    border: none;
    font-weight: 800;
    font-size: 13.5px;
    padding: 10px 22px;
    border-radius: 9px;
    box-shadow: 0 4px 10px rgba(14, 159, 110, .3);
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    transition: filter .2s;
}
.btn-copy:hover { filter: brightness(1.08); }

.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
    position: absolute;
    display: block;
    border-radius: 50%;
}
.confetti i:nth-child(1) { width: 8px; height: 8px; background: #f9a904; top: 2px; left: 60px; }
.confetti i:nth-child(2) { width: 6px; height: 6px; background: #0e9f6e; top: 20px; left: 20px; }
.confetti i:nth-child(3) { width: 7px; height: 7px; background: #7c3aed; top: 0; left: 110px; }
.confetti i:nth-child(4) { width: 5px; height: 5px; background: #ef2d3a; top: 34px; left: 90px; }
.confetti i:nth-child(5) { width: 6px; height: 6px; background: #3b6ef0; top: 40px; left: 40px; }

@media (max-width: 768px) {
    .modal { padding: 26px 22px 22px; }
    .socials-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .modal-head h3 { font-size: 18px; }
    .modal-head .rocket { width: 46px; height: 46px; }
    .modal-head .rocket svg { width: 26px; height: 26px; }
}
@media (max-width: 576px) {
    .modal { padding: 22px 18px 18px; }
    .socials-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .soc .bubble { width: 44px; height: 44px; border-radius: 12px; }
    .soc .bubble svg { width: 20px; height: 20px; }
    .copy-row { padding: 6px 6px 6px 12px; }
    .btn-copy { padding: 9px 16px; font-size: 12.5px; }
}
@media (max-width: 420px) {
    .modal { padding: 20px 16px 16px; max-width: 100%; }
    .modal-head h3 { font-size: 17px; }
    .modal-head p { font-size: 12px; }
    .modal-head .rocket { width: 40px; height: 40px; border-radius: 12px; }
    .modal-head .rocket svg { width: 22px; height: 22px; }
    .socials-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .soc .bubble { width: 40px; height: 40px; }
    .soc span { font-size: 10px; }
}

/* Star rating variable used by tool cards */
:root {
    --star: #f9a904;
}