@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --card-border: #e1e3e5;
    --card-hover-border: #c9cccf;
    --primary: #000000;
    --primary-hover: #333333;
    --text-main: #202223;
    --text-muted: #6d7175;
    --success: #008060; /* Shopify Green */
    
    /* Code block colors */
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --code-header: #2d2d2d;
    --code-border: #444444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
}

.header-container h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.header-container p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: #f9fafb;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: #ffffff;
    border-color: var(--card-hover-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.social-btn svg {
    width: 16px;
    height: 16px;
}

.social-btn.instagram:hover svg { color: #E1306C; }
.social-btn.tiktok:hover svg { color: #000000; }
.social-btn.whatsapp:hover svg { color: #25D366; }

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 0.85rem 1.5rem 0.85rem 3rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

.tab-btn.active {
    background: #ffffff;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#back-to-templates {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
#back-to-templates:hover {
    background: #f9fafb;
    border-color: var(--card-hover-border);
}


/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Template Detail Split Layout */
.template-detail-container {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

@media (min-width: 992px) {
    .template-detail-container {
        flex-direction: row;
        align-items: stretch;
    }
}

.template-detail-visuals {
    flex: 1;
    padding: 2.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    min-height: 400px;
}

@media (min-width: 992px) {
    .template-detail-visuals {
        border-bottom: none;
        border-right: 1px solid var(--card-border);
    }
}

.template-detail-visuals img, .template-detail-visuals video {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
}

.live-preview-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    padding: 2rem;
    overflow: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
}

.template-detail-codes {
    flex: 1;
    padding: 2rem;
    max-height: 800px;
    overflow-y: auto;
    background: #ffffff;
}

/* Scrollbar for codes container */
.template-detail-codes::-webkit-scrollbar {
    width: 6px;
}
.template-detail-codes::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* Accordion */
.code-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.accordion-item {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    background: #f9fafb;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
    color: var(--text-main);
}

.accordion-header:hover {
    background: #f1f2f4;
}

.accordion-item.open .accordion-header {
    border-bottom-color: var(--card-border);
}

.accordion-header .icon {
    transition: transform 0.2s ease;
    stroke: var(--text-muted);
}

.accordion-item.open .accordion-header .icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 1.25rem;
    background: #ffffff;
}

.accordion-item.open .accordion-content {
    display: block;
}

/* Code Block Styling */
.code-wrapper {
    position: relative;
    background: var(--code-bg);
    border-radius: 6px;
    border: 1px solid var(--code-border);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--code-header);
    border-bottom: 1px solid var(--code-border);
}

.code-lang {
    font-size: 0.75rem;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.copy-btn {
    background: #444444;
    border: none;
    color: #ffffff;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    background: #555555;
}

.code-wrapper pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    color: var(--code-text);
    max-height: 400px;
    line-height: 1.4;
}

.code-wrapper pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.code-wrapper pre::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 4px;
}
.code-wrapper pre::-webkit-scrollbar-track {
    background: transparent;
}


/* Custom Codes Grid */
.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.custom-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.custom-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.custom-card-img {
    height: 180px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--card-border);
    overflow: hidden;
    position: relative;
}

.custom-card-img img, .custom-card-img video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.no-image-placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.category-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.custom-card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #000000;
}

.custom-card-content .code-wrapper {
    margin-top: auto;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.3);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Utilities */
.hidden {
    display: none !important;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed var(--card-border);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}
