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

:root {
    --bg-color: #48501a;
    --text-color: #fdf46d;
    --accent-color: #fdf46d; /* Used for buttons/links mainly */
    --accent-bg: #5a6422; /* Slightly lighter than bg for cards/sections */
    --gray-light: #5a6422; /* Replaced light gray with accent bg */
    --gray-medium: #d4d4d4;
    --border-color: #6b772a;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    background: var(--bg-color);
}

.site-header .container {
    display: flex;
    flex-direction: column; /* Stack logo and nav */
    align-items: center; /* Center horizontally */
    gap: 15px;
}

.logo {
    text-align: center;
}

.logo a {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    font-family: var(--font-heading);
    text-transform: uppercase;
    text-decoration: none;
}

.slogan {
    display: block;
    font-size: 0.9rem;
    font-weight: 300;
    margin-top: 5px;
    color: var(--gray-medium);
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
    text-decoration: none;
}

.main-nav a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--gray-medium);
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    margin: 0 10px;
    color: var(--text-color);
}

.visitor-count {
    font-family: monospace;
    font-size: 1rem;
    margin-top: 10px;
    color: #fff;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff; /* White for strong contrast on dark green */
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray-medium);
    margin-bottom: 2rem;
}

/* Search Form */
.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.search-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 6px;
    font-size: 1rem;
    color: #333;
}

.search-form button {
    padding: 12px 24px;
    background: var(--accent-color);
    color: var(--bg-color); /* Dark text on yellow button */
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
}

/* Slider */
.home-slider {
    margin: 20px auto 50px;
    max-width: 1000px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--accent-bg);
    min-height: 300px;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
}

.slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.slider-btn {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 15px;
    border-radius: 50%;
    user-select: none;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filters a {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
}

.filters a.active, .filters a:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

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

.template-card {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-image {
    position: relative;
    height: 220px;
    background: #333;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    background: #666;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.btn-outline {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    background: transparent;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    opacity: 1;
}

.card-content {
    padding: 20px;
}

.category-tag {
    font-size: 0.8rem;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.template-card h3 {
    font-size: 1.2rem;
    margin: 8px 0 15px;
    font-weight: 600;
}

.template-card h3 a {
    color: #fff;
    text-decoration: none;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.download-count {
    font-size: 0.85rem;
    color: var(--gray-medium);
}

.btn-download {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    font-family: var(--font-heading);
}

.btn-download:hover {
    background: #fff;
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-medium);
}

.modal h2 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.modal p {
    color: var(--gray-medium);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
    color:black;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    background: #fff;
    color: #333;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-heading);
}

.btn-submit:hover {
    background: #fff;
}

/* Template Detail */
.template-detail {
    padding: 60px 20px;
}

.detail-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
}

.category-badge {
    background: var(--accent-bg);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.detail-meta {
    color: var(--gray-medium);
    font-size: 0.95rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.detail-image {
    background: var(--accent-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.detail-image img {
    width: 100%;
    display: block;
}

.detail-sidebar .action-box {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.btn-download-large, .btn-preview-large {
    display: block;
    width: 100%;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    font-family: var(--font-heading);
}

.btn-download-large {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
}

.btn-download-large:hover {
    background: #fff;
}

.btn-preview-large {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-preview-large:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.description-box h3 {   
    margin-bottom: 15px;
    color: var(--text-color);
}

.description-box p {
    color: var(--gray-medium);
}

@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .main-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
