/* ============================================================
   pages/tools.css — AI Tools Directory styles
   ============================================================ */

/* ── Hero ── */
.tools-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 56px 0 48px;
}

.tools-hero-inner {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: center;
}

.tools-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.tools-hero-sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 8px;
}

.tools-search-form {
    display: flex;
    gap: 8px;
}

.tools-search-input-wrap {
    flex: 1;
    position: relative;
}

.tools-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}

.tools-search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    background: var(--surface-2, #161929);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.tools-search-input:focus { border-color: rgba(255,92,53,0.5); }
.tools-search-input::placeholder { color: var(--text-faint); }

/* ── Featured section ── */
.tools-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}

.tools-section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.featured-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.featured-tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}

.featured-tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.featured-tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grad-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.featured-tool-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Tool logo ── */
.tool-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--grad-purple);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.tool-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tool-logo-sm  { width: 36px; height: 36px; border-radius: 8px; font-size: 1rem; }
.tool-logo-xs  { width: 28px; height: 28px; border-radius: 6px; font-size: 0.75rem; }
.tool-logo-lg  { width: 64px; height: 64px; border-radius: 14px; font-size: 1.6rem; }

.tool-name     { font-weight: 700; font-size: 0.92rem; }
.tool-category { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.tool-tagline  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* ── Save button ── */
.tool-save-btn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    width: 30px; height: 30px;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.tool-save-btn:hover { border-color: #ff5c35; color: #ff5c35; }
.tool-save-btn.saved { border-color: #ff5c35; color: #ff5c35; background: rgba(255,92,53,0.08); }

/* ── Pricing badge ── */
.tool-pricing {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tool-pricing-free     { background: rgba(0,229,122,0.12); color: #00e57a; }
.tool-pricing-freemium { background: rgba(255,184,0,0.12); color: #ffb800; }
.tool-pricing-paid     { background: rgba(255,92,53,0.12);  color: #ff5c35; }
.tool-pricing-contact  { background: rgba(168,85,247,0.12); color: #a855f7; }

.tool-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.tool-rating { font-size: 0.78rem; color: var(--accent-yellow); font-weight: 600; }
.tool-saves  { font-size: 0.75rem; color: var(--text-faint); }

/* ── Main layout ── */
.tools-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Sidebar ── */
.tools-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 6px;
    padding: 0 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.83rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
    gap: 6px;
}

.filter-item:hover { background: var(--surface); color: var(--text); }
.filter-item.active { background: var(--surface); color: var(--text); font-weight: 600; }

.filter-count {
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 8px;
}

.sidebar-cta-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.sidebar-cta p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Results bar ── */
.tools-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tools-results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tools-results-count strong { color: var(--text); }
.tools-results-count em { font-style: normal; color: var(--text); }

.clear-filters {
    color: var(--accent-cyan);
    font-size: 0.8rem;
    margin-left: 8px;
    transition: opacity 0.15s;
}
.clear-filters:hover { opacity: 0.7; }

.tools-page-indicator {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tools grid ── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, transform 0.15s;
}

.tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.tool-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-card-logo-link { text-decoration: none; flex-shrink: 0; }
.tool-card-info { flex: 1; min-width: 0; }
.tool-card-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    text-decoration: none;
    display: block;
    transition: color 0.15s;
}
.tool-card-name:hover { color: var(--accent-orange); }

.tool-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tool-card-stats { display: flex; align-items: center; gap: 8px; }

.tool-visit-btn {
    display: block;
    text-align: center;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
    margin-top: 2px;
}

.tool-visit-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(255,92,53,0.05);
}

/* ── Tool detail page ── */
.tool-detail-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
}

.tool-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 24px;
}

.tool-detail-logo {
    width: 80px; height: 80px;
    border-radius: 18px;
    background: var(--grad-purple);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.tool-detail-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.tool-detail-meta { flex: 1; }

.featured-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(255,184,0,0.12);
    border: 1px solid rgba(255,184,0,0.25);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-yellow);
    margin-bottom: 8px;
}

.tool-detail-name {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.tool-detail-tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

.tool-detail-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.tool-rating-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(255,184,0,0.1);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-yellow);
}

.tool-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.tool-save-btn-lg {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.tool-save-btn-lg:hover { border-color: #ff5c35; color: #ff5c35; }
.tool-save-btn-lg.saved { border-color: #ff5c35; color: #ff5c35; background: rgba(255,92,53,0.08); }

/* ── Detail layout ── */
.tool-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    padding-top: 36px;
    padding-bottom: 80px;
    align-items: start;
}

.tool-section {
    margin-bottom: 40px;
}

.tool-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tool-section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.tool-description {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.tool-screenshot {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.tool-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tool-tag {
    display: inline-flex;
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}

.tool-tag:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* ── Reviews ── */
.review-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.review-form-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-rating-input input { display: none; }

.star-rating-input label {
    font-size: 1.6rem;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.1s;
    line-height: 1;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: var(--accent-yellow);
}

.my-review-notice {
    padding: 12px 16px;
    background: rgba(0,229,122,0.05);
    border: 1px solid rgba(0,229,122,0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.review-login-prompt {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.reviews-list { display: flex; flex-direction: column; gap: 16px; }

.review-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.review-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.review-avatar img { width: 100%; height: 100%; object-fit: cover; }

.review-user { font-weight: 600; font-size: 0.88rem; }

.review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.review-stars { color: var(--accent-yellow); font-size: 0.8rem; letter-spacing: 1px; }
.review-date  { font-size: 0.73rem; color: var(--text-faint); }
.review-body  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ── Sidebar card ── */
.tool-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    position: sticky;
    top: calc(var(--nav-height) + 16px);
}

.tool-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
    gap: 8px;
}

.tool-info-row:last-of-type { border-bottom: none; }

.tool-info-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Related tools ── */
.tool-related { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }

.tool-related-title {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.related-tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: opacity 0.15s;
}

.related-tool-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-tool-item:hover { opacity: 0.8; }

.related-tool-name { font-size: 0.83rem; font-weight: 600; }
.related-tool-tagline { font-size: 0.72rem; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .featured-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .tools-hero-inner { grid-template-columns: 1fr; }
    .tools-layout { grid-template-columns: 1fr; }
    .tools-sidebar { position: static; }
    .tool-detail-header { flex-direction: column; }
    .tool-detail-layout { grid-template-columns: 1fr; }
    .tool-info-card { position: static; }
}

@media (max-width: 600px) {
    .featured-tools-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool-detail-header { gap: 16px; }
}
