/* Color Palette Matching Original Design */
:root {
    --bg-dark: #090d16;
    --card-bg: #131224;
    --border-color: #1a1a30;
    --primary-purple: #4d46e5;
    --text-white: #ffffff;
    --text-muted: #94a3b8;
    
    /* Tag Badge Colors */
    --tag-teal: #14b8a6;
    --tag-blue: #38bdf8;
    --tag-green: #4ade80;
    --tag-purple: #a855f7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    padding-bottom: 60px;
}



/* Header Component */
.gallery-header {
    text-align: center;
    padding: 60px 20px 40px 20px;
}

.gallery-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.gallery-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 3-Column Grid Configuration */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 4%;
}

/* Card Breakpoints for Responsiveness */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* Individual Portfolio Card Architecture */
.template-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-5px);
    border-color: #2b2a4a;
}

/* Inner Thumbnail Box (Matching Purple Gradients) */
.card-preview-area {
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}
/* NEW SECTION: Template Library Showcase */
 .template-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
     gap: 2rem;
 }

 .template-card {
     background: var(--card-dark);
     border-radius: 12px;
     border: 1px solid var(--border);
     overflow: hidden;
     transition: all 0.3s;
 }

 .template-card:hover {
     transform: translateY(-5px);
     border-color: var(--primary);
 }

 .template-info {
     padding: 1.5rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

 .template-tag {
     background: #1e293b;
     padding: 0.25rem 0.5rem;
     border-radius: 4px;
     font-size: 0.75rem;
     color: var(--accent);
 }

 /* Ensure the thumbnail container hides any scaling overflows */
 .template-thumb {
     height: 220px;
     max-height: 220px;
     min-height: 220px;
     background: linear-gradient(135deg, #1e1b4b, #311042);
     display: flex;
     align-items: center;
     justify-content: center;
     color: rgba(255, 255, 255, 0.3);
     font-weight: bold;
     overflow: hidden;
     /* Added to keep image inside bounds */
     position: relative;
 }

 /* Force the preview image to scale nicely inside the box */
 .template-thumb img {
     width: 100%;
     height: 100%;
     max-height: 220px;
     object-fit: cover;
     object-position: top;
     /* Forces image to fill the area without stretching distortion */
     display: block;
 }

 /* Fix text and tag layout under the image */
 .template-info {
     padding: 1.5rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
     background: var(--card-dark);
     /* Ensures contrast behind text */
 }

/* Varied Gradient Backdrops to mimic deep purple tints */
.image-bg-1 { background: linear-gradient(135deg, #1d1135 0%, #150924 100%); }
.image-bg-2 { background: linear-gradient(135deg, #24113b 0%, #11071d 100%); }
.image-bg-3 { background: linear-gradient(135deg, #1b0f38 0%, #120b24 100%); }
.image-bg-4 { background: linear-gradient(135deg, #161623 0%, #0d0d14 100%); }
.image-bg-5 { background: linear-gradient(135deg, #2c123d 0%, #190a24 100%); }
.image-bg-6 { background: linear-gradient(135deg, #111a2e 0%, #070c17 100%); }

.preview-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* Card Content Strip Details */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #0d0c1b;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.template-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Badges Tags Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.cyberpunk {
    background-color: rgba(20, 184, 166, 0.1);
    color: var(--tag-teal);
}

.clean-text {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--tag-blue);
}

.interactive {
    background-color: rgba(74, 222, 128, 0.1);
    color: var(--tag-green);
}

.dark {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.vibrant {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--tag-purple);
}

.tech {
    background-color: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}