/* ==================== AIIIN Company Card (shared: Home featured + directory) ==================== */

.dir-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid #F3F4F6;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.dir-card:hover {
    transform: translateY(-4px);
    border-color: #818CF8;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ---- Corner badges ---- */
.dir-badges {
    position: absolute;
    top: -1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dir-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    color: #fff;
    white-space: nowrap;
}

.dir-badge--sponsored {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.dir-badge--featured {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.dir-badge--new {
    background: #ECFDF5;
    color: #059669;
    font-size: 0.62rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

.dir-badge--star {
    position: absolute;
    top: -1rem;
    right: 1rem;
    z-index: 2;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

/* ---- Head ---- */
.dir-card-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dir-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    padding: 0.35rem;
    border-radius: 12px;
    object-fit: contain;
    background: #F9FAFB;
}

.dir-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
}

.dir-logo-fallback i {
    color: #4F46E5;
    font-size: 1.1rem;
}

.dir-title-wrap {
    min-width: 0;
}

.dir-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dir-chip {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
}

.dir-chip--private { background: #ECFDF5; color: #059669; }
.dir-chip--govt { background: #EEF2FF; color: #4F46E5; }
.dir-chip--category { background: #FFF7ED; color: #EA580C; }

.dir-rating {
    margin-left: auto;
    flex-shrink: 0;
    text-align: right;
}

/* ---- Body ---- */
.dir-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.65rem;
}

.dir-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding: 0.2rem 0.45rem;
    border: 1px solid #F3F4F6;
    border-radius: 8px;
    background: #F9FAFB;
    color: #4B5563;
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1.3;
}

.dir-meta-item i {
    color: #4F46E5;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.dir-meta-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dir-desc {
    flex: 1;
    margin-bottom: 1rem;
    color: #6B7280;
    font-size: 0.82rem;
    line-height: 1.6;
}

.dir-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.dir-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dir-btn i { font-size: 0.7rem; }

.dir-btn--primary {
    flex: 1;
    background: #EEF2FF;
    color: #4F46E5;
}

.dir-btn--primary:hover {
    background: #4F46E5;
    color: #fff;
}

.dir-btn--visit {
    padding: 0.55rem 0.9rem;
    background: #F3F4F6;
    color: #6B7280;
}

.dir-btn--visit:hover {
    background: #4F46E5;
    color: #fff;
}

/* ---- Footer ---- */
.dir-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.dir-call {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #D1FAE5;
    border-radius: 50%;
    background: #ECFDF5;
    color: #059669;
    font-size: 0.72rem;
    text-decoration: none;
    transition: all 0.2s ease;
    z-index: 1;
}

.dir-call:hover {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.dir-footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dir-footer-note {
    font-size: 0.7rem;
    color: #9CA3AF;
}

.dir-footer-note i {
    margin-right: 0.15rem;
}

.dir-footer-note .dir-sponsored-votes { color: #4F46E5; }

.dir-card .star-static {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.dir-card .star-static .star {
    font-size: 0.7rem;
    color: #D1D5DB;
}

.dir-card .star-static .star.active { color: #F59E0B; }

.dir-card .star-static .star-count {
    font-size: 0.65rem;
    color: #9CA3AF;
}

.dir-card .upvote-btn-dir {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: none;
    color: #6B7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dir-card .upvote-btn-dir i { font-size: 0.7rem; }

.dir-card .upvote-btn-dir:hover,
.dir-card .upvote-btn-dir.upvoted {
    border-color: #4F46E5;
    background: #EEF2FF;
    color: #4F46E5;
}

.dir-card .upvote-btn-dir.upvoted { font-weight: 600; }

.dir-card .watch-btn-dir {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: none;
    color: #6B7280;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dir-card .watch-btn-dir:hover,
.dir-card .watch-btn-dir.watched {
    border-color: #4F46E5;
    background: #EEF2FF;
    color: #4F46E5;
}

/* ==================== Dark theme ==================== */
[data-theme="dark"] .dir-card {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .dir-card:hover {
    border-color: #818CF8;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .dir-title { color: #E2E8F0; }

[data-theme="dark"] .dir-logo { background: #0F172A; }

[data-theme="dark"] .dir-logo-fallback { background: rgba(129, 140, 248, 0.15); }
[data-theme="dark"] .dir-logo-fallback i { color: #818CF8; }

[data-theme="dark"] .dir-chip--private { background: rgba(52, 211, 153, 0.15); color: #34D399; }
[data-theme="dark"] .dir-chip--govt { background: rgba(129, 140, 248, 0.15); color: #818CF8; }
[data-theme="dark"] .dir-chip--category { background: rgba(251, 191, 36, 0.15); color: #FBBF24; }

[data-theme="dark"] .dir-desc { color: #94A3B8; }

[data-theme="dark"] .dir-meta-item {
    background: #0F172A;
    border-color: #334155;
    color: #94A3B8;
}

[data-theme="dark"] .dir-meta-item i { color: #818CF8; }

[data-theme="dark"] .dir-btn--primary { background: rgba(129, 140, 248, 0.15); color: #818CF8; }
[data-theme="dark"] .dir-btn--primary:hover { background: #818CF8; color: #0F172A; }

[data-theme="dark"] .dir-btn--visit { background: #334155; color: #94A3B8; }
[data-theme="dark"] .dir-btn--visit:hover { background: #818CF8; color: #0F172A; }

[data-theme="dark"] .dir-footer { border-top-color: #334155; }
[data-theme="dark"] .dir-call {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: #34D399;
}
[data-theme="dark"] .dir-call:hover { background: #34D399; color: #0F172A; }
[data-theme="dark"] .dir-footer-note { color: #64748B; }
[data-theme="dark"] .dir-footer-note .dir-sponsored-votes { color: #818CF8; }

[data-theme="dark"] .dir-card .star-static .star { color: #475569; }
[data-theme="dark"] .dir-card .star-static .star.active { color: #FBBF24; }
[data-theme="dark"] .dir-card .star-static .star-count { color: #64748B; }

[data-theme="dark"] .dir-card .upvote-btn-dir,
[data-theme="dark"] .dir-card .watch-btn-dir {
    border-color: #334155;
    color: #94A3B8;
}

[data-theme="dark"] .dir-card .upvote-btn-dir:hover,
[data-theme="dark"] .dir-card .upvote-btn-dir.upvoted,
[data-theme="dark"] .dir-card .watch-btn-dir:hover,
[data-theme="dark"] .dir-card .watch-btn-dir.watched {
    border-color: #818CF8;
    background: rgba(129, 140, 248, 0.15);
    color: #818CF8;
}

@media (max-width: 575px) {
    .dir-card { padding: 1.15rem; }
}
