body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #fff;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

.header {
    border-bottom: 1px solid #e0e0e0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo a {
    font-size: 2rem;
    font-weight: bold;
    color: #000;
    letter-spacing: 2px;
}

.logo .logo-blue {
    color: #4285f4;
    background-color: #dae6fa;
    padding: 0 5px;
    border-radius: 4px;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 1rem;
    color: #5f6368;
    font-weight: 500;
}

.nav-link i {
    font-size: 0.8rem;
    margin-left: 0.2rem;
    transition: transform 0.2s ease-in-out;
}

.nav-item:hover .nav-link i {
    transform: rotate(180deg);
}

.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-top: 1rem;
    z-index: 1000;
}

.mega-menu.show {
    display: block;
}

.mega-menu-content {
    display: flex;
    justify-content: space-between;
}

.mega-menu-column {
    width: 23%;
}

.mega-menu-column h3 {
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.mega-menu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-column ul li {
    margin-bottom: 0.75rem;
}

.mega-menu-column ul li a {
    color: #5f6368;
    font-size: 0.9rem;
}

.mega-menu-column ul li a:hover {
    color: #1967d2;
}

.search-bar {
    display: flex;
    align-items: center;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    padding: 0.5rem 1rem;
    width: 350px;
    background-color: #f1f3f4;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.search-bar:hover {
    box-shadow: 0 1px 6px rgb(32 33 36 / 28%);
    background-color: #fff;
}

.search-bar:focus-within {
    background-color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 6px rgb(32 33 36 / 28%);
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 1rem;
}

.search-bar input::placeholder {
    color: #6c757d;
}

.search-bar button {
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #5f6368;
    font-size: 1.2rem;
}

.main-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.main-content {
    text-align: left;
}

.main-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 1rem;
    margin-top: 10px;
}

.main-description {
    font-size: 1.1rem;
    color: #5f6368;
    max-width: 1000px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.templates-section {
    display: flex;
    gap: 2rem;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.category-dropdown-toggle {
    display: none; /* Hide toggle on desktop */
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-right: 1px solid #e0e0e0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.75rem 0;
    cursor: pointer;
}

.category-item:hover a, .category-item:hover span {
    color: #4285f4;
}

.category-item.active a {
    font-weight: bold;
    color: #1967d2;
}
.category-item.active {
    border-right: 2px solid #1967d2;
    padding-right: calc(1rem - 2px);
}

.category-item a {
    font-size: 1rem;
    color: #3c4043;
}

.category-item span {
    font-size: 1rem;
    color: #2D3239;
}

.category-item.active span {
    color: #1967d2;
    font-weight: 600;
}

.templates-grid-wrapper {
    flex-grow: 1;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.template-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.template-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.template-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.template-image img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.template-card h3 {
    font-size: 1.1rem;
    margin: 1rem 1rem 0.5rem 1rem;
    font-weight: 500;
}

.template-card p {
    font-size: 0.9rem;
    color: #5f6368;
    margin: 0 1rem 1rem 1rem;
    line-height: 1.5;
    /* height: auto; */
    /* overflow: visible; */
    /* display: block; */
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-summary {
    color: #5f6368;
    font-size: 0.9rem;
    margin-left: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination a.page-item, .pagination span.page-item-ellipsis {
    padding: 8px 12px;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    font-size: 14px;
    color: #5f6368;
    text-decoration: none;
}

.pagination a.page-item.active {
    background-color: #4285f4;
    color: white;
    border-color: #4285f4;
}

.pagination .page-item-ellipsis {
    border: none;
}

.pagination .next-page-btn {
    background-color: #4285f4;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}
.pagination .next-page-btn:after {
    content: ' ›';
    font-size: 16px;
}

.trending-section {
    margin-top: 4rem;
}

.trending-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.trending-section .template-card h3 {
    min-height: 44px;
}

@media (min-width: 1200px) {
    .trending-section .templates-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .header-center {
        position: static;
        transform: none;
        width: 100%;
        order: 2;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        display: none;
    }

    .search-bar {
        width: 100%;
        box-sizing: border-box;
    }

    .nav {
        display: none; /* Hide full nav on mobile, needs hamburger */
    }

    .main-title {
        font-size: 28px;
    }

    .templates-section {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
    }

    .category-dropdown {
        position: relative;
    }

    .category-dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 16px 16px;
        font-size: 1rem;
        background-color: #ffffff;
        border: 1px solid #4485f6a6;
        border-radius: 4px;
        cursor: pointer;
        text-align: left;
        font-weight: 500;
        box-sizing: border-box;
    }

    .category-dropdown-toggle i {
        margin-left: auto;
        font-size: 0.9rem;
        transition: transform 0.3s ease;
    }

    .category-dropdown.is-open .category-dropdown-toggle {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-color: #4485f6a6;
    }

    .category-dropdown.is-open .category-dropdown-toggle i {
        transform: rotate(180deg);
    }

    .category-list {
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        background-color: #fff;
        border: 1px solid #4485f6a6;
        border-top: none;
        border-radius: 0 0 4px 4px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 10;
        overflow-y: auto;
    }

    .category-dropdown.is-open .category-list {
        max-height: 60vh; /* Adjust as needed */
        opacity: 1;
        display: flex;
        flex-direction: column;
    }

    .category-list::-webkit-scrollbar {
        display: block;
        width: 5px;
    }
    .category-list::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 10px;
    }

    .category-item {
        flex-basis: 100%;
        padding: 0.75rem 1rem;
        margin: 0;
        border-bottom: 1px solid #e0e0e0;
        justify-content: space-between;
    }

    .category-item:last-child {
        border-bottom: none;
    }

    .category-item.active {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        background-color: #f8f9fa;
    }

    .category-item.active a, .category-item.active span {
        color: #1967d2;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .template-card h3 {
        font-size: 1rem;
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }

    .template-card p {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
        margin-bottom: 0.75rem;
    }
} 