/* Template Marketplace Frontend Styles */

/* Container and Layout */
.template-marketplace-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.template-marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Search and Filters */
.template-search {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.template-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.template-search input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.template-search .search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.template-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.template-filters select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
}

/* Grid Layout */
.template-marketplace-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.template-marketplace-grid.columns-1 {
    grid-template-columns: 1fr;
}

.template-marketplace-grid.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.template-marketplace-grid.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.template-marketplace-grid.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Template Cards */
.template-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.template-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: #f8f9fa;
}

.template-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-card:hover .template-card-image img {
    transform: scale(1.05);
}

.template-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 48px;
}

.template-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover .template-card-overlay {
    opacity: 1;
}

.template-card-content {
    padding: 20px;
}

.template-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.template-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.template-title a:hover {
    color: #0073aa;
}

.template-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.template-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.feature-more {
    background: #f5f5f5;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.template-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.template-price {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.template-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn-demo {
    background: #6c757d;
    color: white;
}

.btn-demo:hover {
    background: #5a6268;
    color: white;
}

.btn-details {
    background: #17a2b8;
    color: white;
}

.btn-details:hover {
    background: #138496;
}

.btn-trial {
    background: #28a745;
    color: white;
}

.btn-trial:hover {
    background: #218838;
}

.btn-purchase {
    background: #007bff;
    color: white;
}

.btn-purchase:hover {
    background: #0056b3;
    color: white;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

/* Single Template View */
.template-single-view {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.template-single-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.template-single-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.template-single-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.template-single-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.template-single-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #444;
}

.template-single-features h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2c3e50;
}

.template-single-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.template-single-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 20px;
}

.template-single-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.template-single-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Modal */
.template-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.template-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.template-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.template-modal-close:hover {
    color: #000;
}

.template-modal-body {
    padding: 30px;
}

/* Pagination */
.template-marketplace-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.template-marketplace-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.template-marketplace-pagination .page-numbers:hover,
.template-marketplace-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* No Templates Found */
.no-templates-found {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-marketplace-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .template-filters {
        justify-content: center;
    }
    
    .template-filters select {
        min-width: auto;
        flex: 1;
    }
    
    .template-marketplace-grid.columns-2,
    .template-marketplace-grid.columns-3,
    .template-marketplace-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .template-single-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .template-single-title {
        font-size: 24px;
    }
    
    .template-single-actions {
        justify-content: center;
    }
    
    .template-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .template-card-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .template-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .template-marketplace-container {
        padding: 15px;
    }
    
    .template-card-content {
        padding: 15px;
    }
    
    .template-modal-body {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

