/* Template Detail Layout */
.template-detail-section {
    padding: 60px 0;
    background-color: #fff;
}

.template-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px;
    align-items: start;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
}

.breadcrumb i {
    font-size: 12px;
    color: #adb5bd;
}

.breadcrumb span {
    color: #333;
    font-weight: 500;
}

/* Template Header */
.template-header {
    margin-bottom: 40px;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.template-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.template-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.template-title {
    font-size: 36px;
    font-weight: 700;
    color: #000;
    margin-bottom: 20px;
    line-height: 1.2;
}

.template-excerpt {
    font-size: 18px;
    color: #6c757d;
    line-height: 1.6;
}

/* Feature Image */
.feature-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Template Content */
.template-content {
    line-height: 1.7;
    color: #333;
}

.template-content h2 {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin: 40px 0 20px 0;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.template-content h2:first-child {
    border-top: none;
    padding-top: 0;
}

.template-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 30px 0 15px 0;
}

.template-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.template-content ul, .template-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.template-content li {
    margin-bottom: 8px;
    font-size: 16px;
}

.template-content strong {
    font-weight: 600;
    color: #000;
}

.template-content a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.template-content a:hover {
    color: #0056b3;
}

.template-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #e83e8c;
}

/* Code Block */
.code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Template Actions */
.template-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

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

.sidebar-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f8f9fa;
}

/* Recent Templates */
.recent-templates {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recent-template {
    display: flex;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f8f9fa;
}

.recent-template:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-template img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.recent-template-content {
    flex: 1;
    min-width: 0;
}

.recent-template-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 6px;
    line-height: 1.3;
}

.recent-template-content p {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    line-height: 1.4;
}

.recent-template-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #6c757d;
}

.recent-template-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 12px;
}

.category-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-list a:hover {
    color: #000;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    background-color: #f8f9fa;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag-cloud .tag:hover {
    background-color: #e9ecef;
    color: #000;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .template-detail-layout {
        grid-template-columns: 1fr 280px;
        gap: 40px;
    }
    
    .template-title {
        font-size: 32px;
    }
    
    .template-content h2 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .template-detail-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .template-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .template-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .template-title {
        font-size: 28px;
    }
    
    .template-content h2 {
        font-size: 22px;
    }
    
    .template-actions {
        flex-direction: column;
    }
    
    .recent-templates {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .recent-template {
        flex-direction: column;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .recent-template img {
        width: 100%;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .template-detail-section {
        padding: 40px 0;
    }
    
    .template-title {
        font-size: 24px;
    }
    
    .template-excerpt {
        font-size: 16px;
    }
    
    .template-content h2 {
        font-size: 20px;
    }
    
    .template-content h3 {
        font-size: 18px;
    }
    
    .breadcrumb {
        font-size: 12px;
        gap: 8px;
    }
    
    .recent-templates {
        grid-template-columns: 1fr;
    }
}


.recent-templates.sidebar {
    padding: 20px 20px;
    background: #f5f5f5;
    margin-top: 20px;
    border-radius: 10px;
    gap: 10px;
}

.recent-templates.sidebar  h3 {
    border-bottom: 1px solid;
    display: inline-block;
    width: max-content;
    padding: 0;
    margin-bottom: 10px;
}

.recent-templates.sidebar  .recent-template {
    border-bottom: 1px solid #d8d8d8;
    transform: translate(0, 0) !important;
    padding-bottom: 0;
}

.recent-templates.sidebar .recent-template-content p {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-templates.sidebar .recent-template a {
    color: #000;
    text-decoration: none;
    transition: 0.3s;
}

.recent-templates.sidebar .recent-template a:hover {
    color: #585858;
}

a.template-link-sidebar {
    width: 100% !Important;
}