/**
 * n8n Templates Styles - Version 2
 * Add this to your child theme's style.css or enqueue as separate file
 */

/* ========================================
   Page Headers
   ======================================== */

.template-archive-header,
.category-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.category-title-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.archive-description,
.category-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
}

/* ========================================
   Template Category Dropdown
   ======================================== */

.template-category-dropdown-wrapper {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.template-category-dropdown {
    width: 100%;
    max-width: 400px;
    padding: 12px 40px 12px 15px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.3s ease;
}

.template-category-dropdown:hover {
    border-color: #333;
    background-color: #f9f9f9;
}

.template-category-dropdown:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

/* ========================================
   Related Categories Section
   ======================================== */

.related-categories-section {
    margin: 40px 0;
    padding: 40px 0;
    border-top: 1px solid #e0e0e0;
}

.related-categories-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #333;
}

.related-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.related-category-card {
    display: flex;
    align-items: center;
    padding: 25px;
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 100px;
}

.related-category-card:hover {
    background-color: #fff;
    border-color: #333;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.related-category-icon {
    font-size: 48px;
    line-height: 1;
    margin-right: 20px;
    flex-shrink: 0;
}

.related-category-content {
    flex: 1;
}

.related-category-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.related-category-card:hover .related-category-name {
    color: #000;
}

.related-category-count {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* ========================================
   Related Templates Section
   ======================================== */

.related-templates-section {
    margin: 40px 0;
    padding: 40px 0 0;
    border-top: 1px solid #e0e0e0;
}

.related-templates-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #333;
}

/* Use existing theme styles for template cards */
.related-templates-section .post-cards--grid {
    margin-top: 0;
}

/* ========================================
   Download Button
   ======================================== */

.template-download-section {
    margin: 40px 0;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    border: 2px dashed #e0e0e0;
}

.template-download-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #333;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-download-btn:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.template-download-btn:active {
    transform: translateY(0);
}

/* ========================================
   No Results Message
   ======================================== */

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.no-results p {
    font-size: 16px;
    color: #666;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media screen and (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }

    .archive-description,
    .category-description {
        font-size: 14px;
    }

    .template-category-dropdown-wrapper {
        margin: 20px 0;
    }

    .template-category-dropdown {
        max-width: 100%;
        font-size: 14px;
        padding: 10px 35px 10px 12px;
    }

    .related-categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .related-category-card {
        padding: 20px;
        min-height: auto;
    }

    .related-category-icon {
        font-size: 36px;
        margin-right: 15px;
    }

    .related-category-name {
        font-size: 16px;
    }

    .related-category-count {
        font-size: 13px;
    }

    .related-categories-title,
    .related-templates-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .related-categories-section,
    .related-templates-section {
        margin: 30px 0;
        padding: 30px 0 0;
    }

    .template-download-section {
        padding: 20px;
        margin: 30px 0;
    }

    .template-download-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .related-category-card {
        flex-direction: column;
        text-align: center;
    }

    .related-category-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* ========================================
   Ensure compatibility with theme
   ======================================== */

/* Override theme link colors */
.related-category-card,
.related-category-card:hover,
.related-category-card:focus {
    color: inherit;
}

/* Ensure proper spacing */
.section-posts {
    margin-top: 0;
}

.section-posts .post-cards--grid {
    margin-top: 0;
}

/* Mobile dropdown adjustments */
@media screen and (max-width: 480px) {
    .template-category-dropdown {
        font-size: 13px;
    }
}
