/* Template Browser - Elegant Design
 * @version 4.1.0
 * @last_updated 2026-04-03
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    color: #1a1a2e;
    line-height: 1.5;
}

/* Container */
.browser-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px 64px;
}

/* Header */
.browser-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.browser-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.browser-badge i {
    font-size: 11px;
}

.browser-header h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1a1a2e 0%, #667eea 50%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.browser-header p {
    font-size: 16px;
    color: #666;
    max-width: 560px;
    margin: 0 auto;
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 32px;
    flex-wrap: wrap;
}

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

.stat-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    padding: 16px 24px;
    background: white;
    border-radius: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.industry-select-wrapper {
    position: relative;
}

.industry-select {
    padding: 10px 40px 10px 20px;
    border-radius: 100px;
    border: 1px solid #e0e0e0;
    background: white;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #1a1a2e;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.industry-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.industry-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.industry-select-wrapper i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 12px;
    pointer-events: none;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
    margin-top: 28px;
}

/* Section Header */
.section-header {
    margin: 56px 0 28px;
    position: relative;
}

.section-header:first-of-type {
    margin-top: 0;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #1a1a2e 0%, #667eea 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.section-header p {
    color: #666;
    margin-top: 6px;
    font-size: 16px;
}

/* Template Card */
.template-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    position: relative;
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

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

.card-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 100%);
    overflow: hidden;
}

.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

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

.preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.preview-btn {
    background: white;
    border: none;
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    color: #667eea;
}

.preview-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 10px;
}

.badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.badge.free {
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.badge.premium {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

.badge.featured {
    background: linear-gradient(135deg, #ff3b30 0%, #ff6b6b 100%);
}

.card-info {
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8edf5 100%);
    color: #667eea;
    text-transform: capitalize;
    white-space: nowrap;
}

.card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: inherit;
}

.action-preview {
    background: #f0f2f5;
    color: #1a1a2e;
}

.action-preview:hover {
    background: #e8edf5;
    transform: translateY(-2px);
}

.action-use {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-use:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    background: white;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #f0f2f5;
    background: white;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e8edf5;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f5f7fa;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: white;
}

.preview-iframe {
    width: 100%;
    height: 550px;
    border: none;
    background: white;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f0f2f5;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Zero State */
.zero-state {
    text-align: center;
    padding: 80px 32px;
    background: white;
    border-radius: 32px;
    margin: 32px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.zero-state i {
    font-size: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.zero-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.zero-state p {
    color: #666;
    margin-bottom: 28px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .browser-container {
        padding: 16px 16px 40px;
    }

    .browser-header {
        margin-bottom: 32px;
    }

    .browser-header h1 {
        font-size: 32px;
    }

    .browser-header p {
        font-size: 14px;
    }

    .stats-row {
        gap: 32px;
        margin-top: 24px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .filter-bar {
        margin-bottom: 32px;
        padding: 12px 20px;
        border-radius: 60px;
        flex-direction: column;
    }

    .filter-group {
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .template-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-header {
        margin: 40px 0 20px;
    }

    .section-header h2 {
        font-size: 26px;
    }

    .section-header p {
        font-size: 14px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .preview-iframe {
        height: 400px;
    }

    .modal-header {
        padding: 18px 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-footer {
        padding: 16px 20px;
    }

    .zero-state {
        padding: 60px 24px;
    }

    .zero-state h3 {
        font-size: 20px;
    }

    .zero-state i {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    .stats-row {
        gap: 24px;
    }

    .stat-number {
        font-size: 20px;
    }

    .card-actions {
        flex-direction: column;
    }

    .action-btn {
        padding: 10px 16px;
    }

    .preview-btn {
        padding: 8px 20px;
        font-size: 12px;
    }
}