/* C:\xampp\htdocs\techsolution\css\templates.css */
/* Dark theme – all elements dark with red accents, white text */

/* Force dark background for the whole page */
body.page-templates {
    background: #0d0d0d !important;
}

.templates-hero {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    padding: 60px 0 40px;
    text-align: center;
    margin-bottom: 40px;
}
.templates-hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}
.templates-hero p {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* Filter bar – dark background, red focus */
.filter-bar {
    background: #1a0709;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 1px solid rgba(208,2,27,0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}
.search-box {
    flex: 2;
    min-width: 180px;
    position: relative;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #af0404;
}
.search-box input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid rgba(208,2,27,0.3);
    border-radius: 40px;
    font-size: 0.85rem;
    outline: none;
    background: #0f0f12;
    color: #fff;
}
.search-box input::placeholder {
    color: rgba(255,255,255,0.4);
}
.search-box input:focus {
    border-color: #D0021B;
}
.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-group select {
    padding: 8px 12px;
    border: 1px solid rgba(208,2,27,0.3);
    border-radius: 40px;
    font-size: 0.85rem;
    background: #0f0f12;
    color: #fff;
    cursor: pointer;
}
.filter-group select option {
    background: #1a0709;
    color: #fff;
}
.results-count {
    font-size: 0.8rem;
    color: #ae030b;
}

/* Template cards – dark background, white text, red hover */
.template-card {
    background: rgba(255,255,255,0.15); 
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(208,2,27,0.2);
    /* ✅ FIXED: removed fixed height, let content breathe */
    display: flex;
    flex-direction: column;
}
.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.5);
    border-color: #D0021B;
}
.img-container {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.template-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #2a0a0f;
    transition: opacity 0.2s;
    display: block;
}
.template-img:hover {
    opacity: 0.9;
}
.image-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.template-body {
    padding: 20px;
    /* ✅ FIXED: flex: 1 so body fills remaining space, no overflow clipping */
    flex: 1;
    display: flex;
    flex-direction: column;
}
.template-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
    /* ✅ FIXED: no line-clamp, full title visible */
    line-height: 1.4;
}
.template-category {
    display: inline-block;
    background: rgba(208,2,27,0.2);
    color: #ad0210;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    width: fit-content;
}
.template-description {
    color: #ddd0d4;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 16px;
    /* ✅ FIXED: flex: 1 pushes meta to bottom, no overflow:hidden, full text shown */
    flex: 1;
    overflow: visible;
    display: block;
}
.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* ✅ FIXED: margin-top: auto pushes it to the bottom regardless of description length */
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(208,2,27,0.2);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}
.template-price {
    font-weight: 700;
    color: #f50404;
}
.badge-free {
    background: rgba(16,185,129,0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
}
.template-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.btn-demo {
    background: transparent;
    border: 1px solid #D0021B;
    color: #da0808;
}
.btn-demo:hover {
    background: #D0021B;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-download {
    background: #D0021B;
    border: 1px solid #D0021B;
    color: #fff;
}
.btn-download:hover {
    background: #a80015;
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-gallery {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ddd0d4;
}
.btn-gallery:hover {
    background: rgba(208,2,27,0.2);
    border-color: #D0021B;
    color: #ff4d6d;
    transform: translateY(-1px);
}

/* Lightbox – already dark, kept as is */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox-img { max-width: 90%; max-height: 80%; object-fit: contain; }
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.4); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 5px;
    font-size: 0.8rem;
}

/* No results message – dark theme */
#noResults {
    color: #ddd0d4;
}
#noResults i {
    color: rgba(255,255,255,0.3);
}
#noResults h4 {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .templates-hero h1 { font-size: 1.8rem; }
    .template-img { height: 160px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-group { justify-content: space-between; }
    .template-buttons { justify-content: flex-end; }
    .template-meta { flex-direction: column; align-items: flex-start; }
}