
.aitdp-directory {
    background: #0a0a0a;
    color: #e5e5e5;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Filter Row */
.aitdp-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 25px;
    background: rgba(255,255,255,0.02);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.aitdp-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
    max-width: 550px;
}

.aitdp-filters input,
.aitdp-filters select {
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #2a2a2a;
    background: #1a1a1a;
    color: #e5e5e5;
    font-size: 14px;
}

.aitdp-filters input {
    flex: 2;
    min-width: 220px;
}

.aitdp-filters select {
    flex: 1;
    min-width: 160px;
}

.aitdp-tabs {
    display: flex;
    gap: 10px;
    background: #1a1a1a;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

.aitdp-tabs button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.aitdp-tabs button.active {
    background: #4a9eff;
    color: #fff;
}

.aitdp-tabs button .tab-count {
    font-size: 11px;
    margin-left: 5px;
    opacity: 0.8;
}

/* Tools Grid */
.aitdp-tools {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ✨ SIMPLE CARD with Top Border Light Effect */
.aitdp-card {
    display: flex;
    gap: 25px;
    background: linear-gradient(145deg, #111 0%, #1a1a1a 100%);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #2a2a2a;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Simple Top Border Light Effect */
.aitdp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #a06af9, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px 16px 0 0;
}

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

.aitdp-card:hover {
    transform: translateY(-3px);
    border-color: #3a3a3a;
}

/* Thumbnail */
.aitdp-thumb {
    flex: 0 0 280px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.aitdp-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.aitdp-placeholder {
    width: 100%;
    height: 180px;
    background: #2a2a2a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* Play Button */
.aitdp-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: none;
    padding: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.aitdp-play:hover {
    background: rgba(74, 158, 255, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Card Info */
.aitdp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 0px !important;
}

.aitdp-info h3 {
    margin: 0;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ✨ Popular/Featured Tool Badges */
.tool-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popular-badge {
    background: linear-gradient(45deg, #f39c12, #f1c40f);
    color: #000;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.3);
}

.featured-badge {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.aitdp-info p {
    color: #bbb;
    margin: 0;
    line-height: 1.6;
    font-size: 15px;
}

/* ✨ Fixed-size description block so every card lines up in the grid */
.aitdp-info p.aitdp-desc {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.6em * 4);
}

.aitdp-readmore {
    display: inline-block;
    color: #a06af9;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.aitdp-readmore:hover {
    text-decoration: underline;
}

/* Clickable areas that open the details popup */
.aitdp-thumb.aitdp-open-details,
h3.aitdp-open-details {
    cursor: pointer;
}

.aitdp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.aitdp-tag {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #ccc;
}

/* Badges */
.aitdp-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.pricing-free { background: #2ecc71; }
.pricing-freemium { background: #3498db; }
.pricing-paid { background: #e67e22; }
.pricing-trial { background: #9b59b6; }

/* Rating */
.aitdp-rating {
    position: absolute;
    top: 65px;
    right: 22px;
    display: flex;
    gap: 2px;
}

.aitdp-rating .star {
    font-size: 18px;
    color: #444;
}

.aitdp-rating .star.filled {
    color: #f39c12;
}

/* Purple Button */
.aitdp-btn {
    margin-top: auto;
    align-self: flex-end;
    padding: 14px 24px;
    background: transparent;
    color: #a06af9;
    border: 2px solid #a06af9;
    border-radius: 40px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.aitdp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #a06af9;
    transition: left 0.3s ease;
    z-index: -1;
    border-radius: 40px;
}

.aitdp-btn:hover::before {
    left: 0;
}

.aitdp-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(160, 106, 249, 0.4);
}

/* Video Popup Styling */
.video-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(10px);
}

.video-popup {
    position: relative;
    background: #111;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
}

.video-popup iframe {
    border-radius: 10px;
    display: block;
}

.video-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-close:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.video-popup-open {
    overflow: hidden !important;
}

/* Tool Details Popup Styling (matches overall dark/purple theme) */
.aitdp-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(10px);
    padding: 30px 15px;
}

.aitdp-details-popup {
    position: relative;
    background: linear-gradient(145deg, #111 0%, #1a1a1a 100%);
    border-radius: 20px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 25px 60px rgba(0,0,0,0.85);
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header image */
.aitdp-details-image {
    position: relative;
    flex-shrink: 0;
}

.aitdp-details-image img,
.aitdp-details-image .aitdp-placeholder {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.aitdp-details-image .aitdp-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: #2a2a2a;
}

.aitdp-details-image::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70px;
    background: linear-gradient(to top, #111, transparent);
    pointer-events: none;
}

/* Close button sits on top of the image, always in view */
.aitdp-details-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(6px);
}

.aitdp-details-close:hover {
    background: #ff4757;
    border-color: #ff4757;
    transform: scale(1.08);
}

/* Scrollable content area */
.aitdp-details-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 26px 30px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aitdp-details-scroll::-webkit-scrollbar {
    width: 8px;
}

.aitdp-details-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.aitdp-details-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.aitdp-details-title {
    margin: 0;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aitdp-details-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
}

.aitdp-details-meta .aitdp-badge {
    position: static;
}

.aitdp-details-meta .aitdp-rating {
    position: static;
}

.aitdp-details-desc {
    color: #bbb;
    line-height: 1.7;
    font-size: 15px;
}

.aitdp-details-desc p {
    margin: 0 0 12px;
}

.aitdp-details-desc p:last-child {
    margin-bottom: 0;
}

.aitdp-details-desc h1,
.aitdp-details-desc h2,
.aitdp-details-desc h3,
.aitdp-details-desc h4 {
    color: #fff;
    margin: 18px 0 8px;
    line-height: 1.4;
}

.aitdp-details-desc ul,
.aitdp-details-desc ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

.aitdp-details-desc a {
    color: #a06af9;
}

.aitdp-details-tags .aitdp-tags {
    margin-top: 0;
}

/* Pinned footer with the CTA so it never scrolls out of view */
.aitdp-details-footer {
    flex-shrink: 0;
    padding: 18px 30px;
    border-top: 1px solid #2a2a2a;
    background: rgba(255,255,255,0.02);
}

.aitdp-details-visit {
    display: block;
    width: 100%;
    text-align: center;
    align-self: auto;
    margin-top: 0;
}

@media (max-width: 600px) {
    .aitdp-details-overlay {
        padding: 15px;
    }

    .aitdp-details-popup {
        max-height: 92vh;
    }

    .aitdp-details-scroll {
        padding: 20px 20px 10px;
    }

    .aitdp-details-footer {
        padding: 14px 20px;
    }

    .aitdp-details-title {
        font-size: 20px;
    }

    .aitdp-details-image img,
    .aitdp-details-image .aitdp-placeholder {
        height: 170px;
    }
}

/* Pagination with Purple Theme */
.aitdp-pagination {
    margin-top: 30px;
    text-align: center;
}

.aitdp-pagination a,
.aitdp-pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
}

.aitdp-pagination a:hover,
.aitdp-pagination .current {
    background: #a06af9;
    color: white;
    border-color: #a06af9;
    box-shadow: 0 4px 15px rgba(160, 106, 249, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .aitdp-filter-row {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .aitdp-card {
        flex-direction: column;
        padding: 20px;
    }

    .aitdp-thumb {
        flex-basis: auto;
    }

    .aitdp-info {
        padding-right: 0;
    }

    .aitdp-badge,
    .aitdp-rating {
        position: static;
        margin: 10px 0 0;
        align-self: flex-start;
    }

    .aitdp-btn {
        align-self: flex-start;
        margin-top: 20px;
    }

    .video-popup {
        margin: 20px;
        padding: 15px;
    }

    .video-popup iframe {
        width: 100%;
        height: 250px;
    }

    .aitdp-info h3 {
        font-size: 20px;
    }

    .tool-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 600px) {
    .aitdp-directory {
        padding: 20px 15px;
    }

    .aitdp-filters {
        flex-direction: column;
        gap: 12px;
    }

    .aitdp-filters input,
    .aitdp-filters select {
        width: 100%;
        min-width: auto;
    }

    .aitdp-tabs button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .video-popup iframe {
        width: 280px;
        height: 160px;
    }
}

/* =========================================
   Responsive Grid Enhancements (FINAL)
   ========================================= */

/* 📱 Mobile (≤ 600px) → 2 columns */
@media (max-width: 600px) {
    .aitdp-tools {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .aitdp-card {
        flex-direction: column;
        height: 100%;
    }

    .aitdp-thumb img,
    .aitdp-placeholder {
        height: 140px;
    }

    .aitdp-btn {
        align-self: stretch;
        text-align: center;
    }
}

/* 📱 Tablet (601px – 900px) → 3 columns */
@media (min-width: 601px) and (max-width: 900px) {
    .aitdp-tools {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .aitdp-card {
        flex-direction: column;
        height: 100%;
    }

    .aitdp-thumb img,
    .aitdp-placeholder {
        height: 160px;
    }

    .aitdp-btn {
        align-self: stretch;
        text-align: center;
    }
}
/* =====================================
   🖥️ Desktop 4-Column Grid (WORKING)
   ===================================== */
@media (min-width: 1200px) {
    .aitdp-tools {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 25px;
    }

    /* Switch cards to vertical layout */
    .aitdp-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    /* Fix thumbnail sizing for grid */
    .aitdp-thumb {
        flex: none;
        width: 100%;
    }

    .aitdp-thumb img,
    .aitdp-placeholder {
        width: 100%;
        height: 160px;
    }

    /* Remove desktop-only padding */
    .aitdp-info {
        padding-right: 0;
    }

    /* Button full width */
    .aitdp-btn {
        align-self: stretch;
        text-align: center;
    }

    /* Badge positioning fix */
    .aitdp-badge,
    .aitdp-rating {
        position: static;
        margin-top: 10px;
        align-self: flex-start;
    }
}



