/**
 * Links Directory Public CSS - GeneratePress Compatible Version
 */

/* Global styling for Links Directory - GeneratePress Compatible */
.link-featured-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.link-featured-image-container {
    margin-bottom: 25px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Rating stars styling */
.rating-stars {
    color: #ffc107;
    margin-right: 8px;
    letter-spacing: 1px;
    font-size: 16px;
    line-height: 1;
}

.star {
    display: inline-block;
}

.star.full, .star.half {
    color: #ffc107;
}

.star.empty {
    color: #e0e0e0;
}

.rating-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Tags Display Styling */
.link-tags {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.link-tags .tags-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.link-tags .tags-title:before {
    content: "🏷️";
    margin-right: 8px;
    font-size: 18px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.link-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff;
    color: #5D5CDE !important;
    text-decoration: none !important;
    border: 1px solid #5D5CDE;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.link-tag svg {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    flex-shrink: 0;
}

.link-tag:hover {
    background: #5D5CDE;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(93, 92, 222, 0.3);
}

.link-tag:focus {
    outline: 2px solid #5D5CDE;
    outline-offset: 2px;
}

/* Tag Archive Header Styling */
.links-tag-header {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.links-tag-header:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="tag-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23dee2e6" opacity="0.3"/></pattern></defs><rect width="100" height="20" fill="url(%23tag-pattern)"/></svg>') repeat;
    opacity: 0.5;
}

.links-tag-header .inside-article {
    position: relative;
    z-index: 1;
}

.tag-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #5D5CDE, #4A49B5);
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(93, 92, 222, 0.3);
}

.tag-header-icon svg {
    color: white;
    width: 32px;
    height: 32px;
}

.links-tag-header .page-title {
    margin-bottom: 15px;
    font-size: 2.5em;
    font-weight: 700;
    color: #333;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tag-description {
    max-width: 600px;
    margin: 0 auto 15px;
    color: #666;
    font-size: 18px;
    line-height: 1.6;
}

.links-tag-header .archive-description {
    max-width: 800px;
    margin: 20px auto 0;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Tag Badge Styling */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #e9ecef;
    color: #6c757d !important;
    text-decoration: none !important;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag-badge svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}

.tag-badge:hover {
    background: #5D5CDE;
    color: white !important;
    border-color: #5D5CDE;
    transform: translateY(-1px);
}

/* Related Tag Links Styling */
.related-link-tag {
    margin-bottom: 8px;
}

.related-link-tag a {
    display: inline-flex;
    align-items: center;
    background: #f1f3f4;
    color: #5f6368 !important;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid #e8eaed;
}

.related-link-tag a:hover {
    background: #5D5CDE;
    color: white !important;
    border-color: #5D5CDE;
    transform: translateY(-1px);
}

/* Category page header styling */
.links-category-header {
    margin-bottom: 30px;
    background-color: #f8f9fa;
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.links-category-header .page-title {
    margin-bottom: 15px;
}

.links-category-header .archive-description {
    max-width: 800px;
    margin: 0 auto;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Link cards grid layout */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.link-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.link-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.link-card-thumbnail {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.link-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.link-card:hover .link-card-thumbnail img {
    transform: scale(1.05);
}

.placeholder-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6a7dfe, #5D5CDE);
    color: white;
    font-size: 40px;
    font-weight: 700;
}

.link-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.link-card-header {
    margin-bottom: 15px;
}

.link-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.link-card-title a {
    color: var(--content-headings-color, #222);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-card-title a:hover {
    color: #5D5CDE;
}

.link-card-rating {
    display: flex;
    align-items: center;
}

.link-card-excerpt {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.link-card-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    gap: 10px;
}

.link-card-details, 
.link-card-visit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.link-card-details svg,
.link-card-visit svg {
    margin-right: 6px;
    width: 16px;
    height: 16px;
}

.link-card-details {
    background: #f1f1f1;
    color: #555 !important;
}

.link-card-visit {
    background: #5D5CDE;
    color: white !important;
}

.link-card-details:hover {
    background: #e5e5e5;
    color: #333 !important;
}

.link-card-visit:hover {
    background: #4A49B5;
    color: white !important;
    transform: translateY(-2px);
}

/* No links found */
.no-links-found {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 40px;
}

.no-links-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.no-links-found h3 {
    font-size: 22px;
    margin: 0 0 10px;
    color: #333;
}

.no-links-found p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

/* Related Links Section */
.related-links-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.related-links-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px;
    text-align: center;
}

.related-links-description {
    color: #666;
    font-size: 16px;
    margin: 0 0 25px;
    text-align: center;
}

.related-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-link-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.related-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.related-link-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-link-thumbnail {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.related-link-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-link-card:hover .related-link-thumbnail img {
    transform: scale(1.05);
}

.related-link-thumbnail.no-thumbnail .placeholder-thumbnail {
    background: linear-gradient(135deg, #5D5CDE, #4A49B5);
    font-size: 36px;
}

.related-link-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-link-category {
    margin-bottom: 8px;
}

.related-link-category a {
    display: inline-block;
    background: #f1f1f1;
    color: #666 !important;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.related-link-category a:hover {
    background: #e5e5e5;
    color: #333 !important;
}

.related-link-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.related-link-title a {
    color: var(--content-headings-color, #222);
    text-decoration: none !important;
}

.related-link-title a:hover {
    color: #5D5CDE;
}

.related-link-rating {
    margin-bottom: 12px;
}

.related-link-rating .rating-stars {
    font-size: 14px;
}

.related-link-actions {
    margin-top: auto;
}

.view-details {
    display: inline-block;
    padding: 6px 14px;
    background: #5D5CDE;
    color: white !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-details:hover {
    background: #4A49B5;
    color: white !important;
    transform: translateY(-2px);
}

/* Single link page specific styles */
.link-entry {
    margin-bottom: 0;
}

.link-entry .entry-header {
    margin-bottom: 25px;
    text-align: center;
}

.link-categories {
    margin-bottom: 15px;
}

.link-category-badge {
    display: inline-block;
    background: #f1f1f1;
    color: #666 !important;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 14px;
    text-decoration: none !important;
    margin: 0 5px 5px 0;
    transition: all 0.2s ease;
}

.link-category-badge:hover {
    background: #e5e5e5;
    color: #333 !important;
}

.link-entry .entry-title {
    margin-bottom: 15px;
}

.link-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
}

.link-rating .rating-stars {
    font-size: 20px;
    margin-right: 10px;
}

.link-rating .rating-text {
    font-size: 16px;
    font-weight: 500;
}

.link-description {
    margin-bottom: 30px;
    color: var(--content-text-color, #222);
}

.link-action {
    text-align: center;
    margin: 30px 0;
}

.link-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    background: #5D5CDE;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
}

.link-button svg {
    margin-left: 10px;
    width: 16px;
    height: 16px;
}

.link-button:hover {
    background: #4A49B5;
    color: white !important;
    transform: translateY(-3px);
}

/* Shortcode directory styling */
.links-directory-container {
    margin: 30px 0;
}

.links-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.category-box {
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
    height: 100%;
}

.category-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #ddd;
}

.category-box-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.category-box-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-box-content {
    padding: 20px;
}

.category-link-count {
    display: inline-block;
    background: #5D5CDE;
    color: white;
    border-radius: 50px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 500;
}

.links-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.links-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.links-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.link-item {
    display: flex;
    align-items: center;
}

.link-item-content {
    flex-grow: 1;
}

.link-item-title {
    font-weight: 500;
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
}

.link-item-title a {
    color: var(--content-link-color, #222);
    text-decoration: none;
}

.link-item-title a:hover {
    color: #5D5CDE;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .related-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .links-category-header,
    .links-tag-header {
        padding: 30px 0;
    }
    
    .links-tag-header .page-title {
        font-size: 2em;
    }
    
    .tag-description {
        font-size: 16px;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .related-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .link-card-actions {
        flex-direction: column;
    }
    
    .related-links-title {
        font-size: 22px;
    }
    
    .tags-list {
        gap: 6px;
    }
    
    .link-tag {
        padding: 5px 10px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .links-category-header,
    .links-tag-header {
        padding: 25px 0;
    }
    
    .links-tag-header .page-title {
        font-size: 1.8em;
    }
    
    .tag-header-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 15px;
    }
    
    .tag-header-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .related-links-grid {
        grid-template-columns: 1fr;
    }
    
    .link-card-actions {
        flex-direction: column;
    }
    
    .related-links-title {
        font-size: 20px;
    }
    
    .related-links-description {
        font-size: 15px;
    }
    
    .link-tags {
        padding: 15px;
        margin: 20px 0;
    }
    
    .tags-list {
        gap: 5px;
    }
    
    .link-tag {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .link-tag svg {
        width: 12px;
        height: 12px;
        margin-right: 4px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark .link-card,
    .dark .related-link-card,
    .dark .category-box {
        background: #222;
        border-color: #333;
    }
    
    .dark .category-box-header,
    .dark .links-category-header,
    .dark .links-tag-header,
    .dark .no-links-found {
        background: #222;
        border-color: #333;
    }
    
    .dark .links-tag-header {
        background: linear-gradient(135deg, #222 0%, #2a2a2a 100%);
    }
    
    .dark .links-list li {
        border-color: #333;
    }
    
    .dark .link-card-title a,
    .dark .related-link-title a {
        color: #eee;
    }
    
    .dark .link-card-excerpt,
    .dark .link-description,
    .dark .links-category-header .archive-description,
    .dark .links-tag-header .archive-description,
    .dark .related-links-description,
    .dark .tag-description {
        color: #aaa;
    }
    
    .dark .link-card-details,
    .dark .link-category-badge,
    .dark .related-link-category a {
        background: #333;
        color: #ccc !important;
    }
    
    .dark .link-card-details:hover,
    .dark .link-category-badge:hover,
    .dark .related-link-category a:hover {
        background: #444;
        color: #fff !important;
    }
    
    .dark .no-links-found h3 {
        color: #eee;
    }
    
    .dark .no-links-found p {
        color: #ccc;
    }
    
    .dark .rating-text {
        color: #aaa;
    }
    
    .dark .star.empty {
        color: #555;
    }
    
    /* Dark mode tags styling */
    .dark .link-tags {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .dark .link-tags .tags-title {
        color: #eee;
    }
    
    .dark .link-tag {
        background: #333;
        border-color: #5D5CDE;
        color: #5D5CDE !important;
    }
    
    .dark .link-tag:hover {
        background: #5D5CDE;
        color: white !important;
    }
    
    .dark .tag-badge {
        background: #333;
        color: #aaa !important;
        border-color: #444;
    }
    
    .dark .tag-badge:hover {
        background: #5D5CDE;
        color: white !important;
    }
    
    .dark .related-link-tag a {
        background: #333;
        color: #aaa !important;
        border-color: #444;
    }
    
    .dark .related-link-tag a:hover {
        background: #5D5CDE;
        color: white !important;
    }
    
    .dark .links-tag-header .archive-description {
        background: rgba(42,42,42,0.9);
        border-color: rgba(255,255,255,0.1);
    }
}