/* Modern Template Shop Styles */

/* CSS Custom Properties */
:root {
    --shop-primary: #EEC225;
    --shop-primary-dark: #d4a91a;
    --shop-primary-light: rgba(238, 194, 37, 0.1);
    --shop-secondary: #64748b;
    --shop-success: #059669;
    --shop-info: #0891b2;
    --shop-warning: #d97706;
    --shop-danger: #dc2626;
    
    --shop-card-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shop-card-shadow-hover: 0 15px 35px rgba(0,0,0,0.15);
    --shop-border-radius: 16px;
    --shop-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --shop-text-primary: #334155;
    --shop-text-secondary: #64748b;
    --shop-text-muted: #94a3b8;
    --shop-bg-light: #f8fafc;
    --shop-border: #e2e8f0;
}

/* Modern Shop Header */
.modern-shop-header {
    background: linear-gradient(135deg, var(--shop-primary-light) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: var(--shop-border-radius);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.shop-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--shop-text-primary);
    margin-bottom: 0.5rem;
}

.shop-subtitle {
    font-size: 1.1rem;
    color: var(--shop-text-secondary);
}

.shop-stats .badge {
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--shop-primary) 0%, var(--shop-primary-dark) 100%);
}

/* Filter Section */
.modern-shop-filters {
    margin-bottom: 2rem;
}

.filter-card {
    border: none;
    box-shadow: var(--shop-card-shadow);
    border-radius: var(--shop-border-radius);
}

.search-box .input-group-text {
    background: transparent;
    border-right: none;
}

.search-box .form-control {
    border-left: none;
    padding-left: 0;
}

.search-box .form-control:focus {
    box-shadow: none;
    border-color: var(--shop-primary);
}

.filter-options .form-select {
    border-radius: 8px;
    border-color: var(--shop-border);
    min-width: 140px;
}

.filter-options .form-select:focus {
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 0.2rem var(--shop-primary-light);
}

/* Modern Template Cards */
.modern-template-card {
    background: white;
    border: none;
    border-radius: var(--shop-border-radius);
    box-shadow: var(--shop-card-shadow);
    transition: var(--shop-transition);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modern-template-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shop-card-shadow-hover);
}

.template-preview-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--shop-bg-light);
}

.template-preview-link {
    display: block;
    height: 100%;
    position: relative;
}

.template-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--shop-transition);
    position: relative;
}

/* For auto-scroll images, use different object-fit */
.template-preview-image.auto-scroll-image {
    object-fit: cover;
    object-position: top;
    height: auto;
    min-height: 100%;
}

/* Auto-scroll animation for tall images */
.auto-scroll-image {
    animation: templateImageAutoScroll 10s ease-in-out infinite;
    height: auto;
    min-height: 100%;
    object-position: top;
}

@keyframes templateImageAutoScroll {
    0% { transform: translateY(0); }
    15% { transform: translateY(0); }
    35% { transform: translateY(-15%); }
    50% { transform: translateY(-30%); }
    65% { transform: translateY(-45%); }
    85% { transform: translateY(-20%); }
    100% { transform: translateY(0); }
}

/* Pause auto-scroll on hover */
.modern-template-card:hover .auto-scroll-image {
    animation-play-state: paused;
}

.template-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;
    opacity: 0;
    transition: var(--shop-transition);
}

.template-preview-link:hover .template-overlay {
    opacity: 1;
}

.template-preview-link:hover .template-preview-image {
    transform: scale(1.1);
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.template-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.template-badge .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
}

.template-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.template-header {
    margin-bottom: 1rem;
}

.template-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--shop-text-primary);
    margin-bottom: 0.5rem;
}

.template-name a {
    color: inherit;
    text-decoration: none;
    transition: var(--shop-transition);
}

.template-name a:hover {
    color: var(--shop-primary);
}

.template-meta {
    font-size: 0.875rem;
    color: var(--shop-text-muted);
}

.template-description {
    flex: 1;
    margin-bottom: 1rem;
}

.template-description p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--shop-text-secondary);
}

.template-price-section {
    margin-bottom: 1.5rem;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-free {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-success);
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-primary);
}

.price-note {
    font-size: 0.8rem;
}

.template-card-actions {
    margin-top: auto;
}

.template-purchase-btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--shop-transition);
}

.template-purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
}

.empty-icon {
    opacity: 0.3;
}

.empty-title {
    color: var(--shop-text-primary);
    margin-bottom: 1rem;
}

.empty-description {
    color: var(--shop-text-secondary);
    font-size: 1.1rem;
}

/* Single Template View Styles */

.modern-preview-card {
    border: none;
    box-shadow: var(--shop-card-shadow);
    border-radius: var(--shop-border-radius);
    overflow: hidden;
}

.template-preview-main {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    transition: var(--shop-transition);
}

/* Auto-scroll for single template view */
.template-preview-main.auto-scroll-image {
    object-fit: cover;
    object-position: top;
    height: auto;
    min-height: 500px;
    max-height: none;
}

/* Pause auto-scroll on hover for single view */
.modern-preview-card:hover .template-preview-main.auto-scroll-image {
    animation-play-state: paused;
}

.template-type-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
}

.preview-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2;
}

.modern-details-card {
    border: none;
    box-shadow: var(--shop-card-shadow);
    border-radius: var(--shop-border-radius);
}

.template-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--shop-text-primary);
}

.template-meta {
    margin-bottom: 1rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
}

.price-section {
    background: var(--shop-bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.price-label {
    font-size: 0.9rem;
    color: var(--shop-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.price-currency {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
}

.price-note {
    font-size: 0.85rem;
}

.action-buttons {
    margin-bottom: 2rem;
}

.template-stats {
    background: var(--shop-bg-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--shop-text-primary);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--shop-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inline Stats Styling */
.template-stats-inline {
    background: var(--shop-bg-light);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.stats-container {
    flex-wrap: wrap;
}

.stat-item-inline {
    font-size: 0.9rem;
    white-space: nowrap;
}

.stat-item-inline i {
    font-size: 1rem;
}

.stat-item-inline .stat-number {
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-item-inline .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Responsive adjustments for inline stats */
@media (max-width: 576px) {
    .stats-container {
        gap: 1rem !important;
        justify-content: space-around !important;
    }

    .stat-item-inline {
        font-size: 0.8rem;
    }

    .stat-item-inline .stat-number {
        font-size: 1rem;
    }

    .stat-item-inline .stat-label {
        font-size: 0.7rem;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--shop-text-primary);
}

.additional-info h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.additional-info ul li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

/* Preview Modal */
.preview-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shop-title {
        font-size: 2rem;
    }
    
    .shop-subtitle {
        font-size: 1rem;
    }
    
    .template-preview-container {
        height: 180px;
    }
    
    .template-card-content {
        padding: 1rem;
    }
    
    .template-title {
        font-size: 1.5rem;
    }
    
    .price-value {
        font-size: 2rem;
    }
    
    .filter-options {
        margin-top: 1rem;
    }
    
    .filter-options .form-select {
        margin-bottom: 0.5rem;
        width: 100%;
    }
}

/* Template Bio Content Styling */
.template-bio-excerpt {
    line-height: 1.4;
}

.template-bio-excerpt strong,
.template-bio-excerpt b {
    color: var(--shop-text-primary);
    font-weight: 600;
}

.template-bio-excerpt em,
.template-bio-excerpt i {
    font-style: italic;
}

.template-bio-content {
    line-height: 1.6;
}

.template-bio-content h3,
.template-bio-content h4 {
    color: var(--shop-text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.template-bio-content h3 {
    font-size: 1.25rem;
}

.template-bio-content h4 {
    font-size: 1.1rem;
}

.template-bio-content ul,
.template-bio-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.template-bio-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.template-bio-content li strong {
    color: var(--shop-primary);
    font-weight: 600;
}

.template-bio-content p {
    margin-bottom: 1rem;
}

.template-bio-content blockquote {
    border-left: 4px solid var(--shop-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    background: var(--shop-primary-light);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* Dark Mode Support */
[data-theme=dark] .modern-template-card {
    background: #242644;
    color: #e2e8f0;
}

[data-theme=dark] .template-bio-content h3,
[data-theme=dark] .template-bio-content h4 {
    color: #e2e8f0;
}

[data-theme=dark] .template-bio-excerpt strong,
[data-theme=dark] .template-bio-excerpt b {
    color: #e2e8f0;
}

/* WhatsApp Store Product Description Styling */
.product-description {
    line-height: 1.4;
}

.product-description strong,
.product-description b {
    color: var(--shop-text-primary);
    font-weight: 600;
}

.product-description em,
.product-description i {
    font-style: italic;
    color: var(--shop-text-secondary);
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .product-description small {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

[data-theme=dark] .filter-card {
    background: #242644;
    color: #e2e8f0;
}

[data-theme=dark] .modern-details-card {
    background: #242644;
    color: #e2e8f0;
}

[data-theme=dark] .template-name {
    color: #e2e8f0;
}

[data-theme=dark] .template-description p {
    color: #a0aec0;
}

[data-theme=dark] .price-section {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme=dark] .template-stats {
    background: rgba(255, 255, 255, 0.05);
}
