/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* Hero Section (unified header + hero) */
.hero {
    background: linear-gradient(135deg, #003545 0%, #005570 100%);
    color: white;
    padding: 0 20px;
    margin-bottom: 0;
}

.hero-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.header-logo img {
    height: 80px;
    display: block;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-socials {
    display: flex;
    gap: 12px;
    align-self: center;
    padding-bottom: 5px;
}

.header-social-link {
    color: white;
    opacity: 0.75;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

.header-social-link:hover {
    opacity: 1;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-btn {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.header-btn--download {
    background: white;
    color: #003545;
}

.header-btn--download:hover {
    background: #e9ecef;
}

.header-btn--github {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-btn--github:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.hero__content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 0 80px;
}

/* Hero CTA */
.hero-cta {
    display: inline-block;
    margin-top: 20px;
    color: white;
    opacity: 0.85;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
    transition: opacity 0.2s ease;
}

.hero-cta:hover {
    opacity: 1;
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #003545 0%, #005570 100%);
    color: white;
    padding: 30px 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-contact {
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    opacity: 0.85;
}

.footer-contact a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-contact a:hover {
    opacity: 1;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

.footer-copyright a {
   color: white; 
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

/* Category Filter Bar */
.category-filter-bar {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Hamburger toggle - hidden on desktop */
.category-menu-toggle {
    display: none;
    background: none;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.category-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #495057;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.category-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    background: white;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
    font-family: inherit;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-btn.active {
    background: #003545;
    color: white;
    border-color: #003545;
}

.category-btn--sponsor {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border-color: #FFA500;
    font-weight: 700;
}

.category-btn--sponsor:hover {
    background: linear-gradient(135deg, #FFC800 0%, #FF9500 100%);
    border-color: #FF8C00;
}

.category-btn--sponsor.active {
    background: #333;
    color: #FFD700;
    border-color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* Tag Filter Bar */
.tag-filter-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.tag-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 14px 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    font-family: inherit;
    transition: color 0.3s ease;
}

.tag-filter-toggle:hover {
    color: #003545;
}

.tag-toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.tag-filter-toggle.open .tag-toggle-icon {
    transform: rotate(180deg);
}

.tag-filter-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-filter-bar .tag-filter-container.open {
    max-height: 200px;
    padding-bottom: 15px;
}

.tag-filter-btn {
    background: white;
    border: 1.5px solid #dee2e6;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    font-family: inherit;
    transition: all 0.2s ease;
}

.tag-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tag-filter-btn.active {
    background: #003545;
    color: white;
    border-color: #003545;
}

.tag-filter-clear {
    background: none;
    border: 1.5px solid #dc3545;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #dc3545;
    font-family: inherit;
    transition: all 0.2s ease;
    display: none;
}

.tag-filter-clear.visible {
    display: inline-block;
}

.tag-filter-clear:hover {
    background: #dc3545;
    color: white;
}

/* Clickable Product Tags */
.product-tag {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-tag:hover {
    background: #003545;
    color: white;
}

.product-tag.active {
    background: #003545;
    color: white;
}

/* Category Sections */
.category-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #212529;
    border-bottom: 3px solid #003545;
    padding-bottom: 10px;
}

/* Show More Button */
.show-more-btn {
    display: block;
    margin: 25px auto 0;
    background: none;
    border: 2px solid #003545;
    color: #003545;
    padding: 10px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background: #003545;
    color: white;
}

.product-card.hidden-card-collapsed {
    display: none !important;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Product Card */
.product-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    border-color: #003545;
}

.product-card.expanded:hover,
.product-card.collapsing:hover {
    transform: translate(-50%, -50%);
}

/* Sponsor Badge */
.sponsor-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.sponsor-card {
    border-color: #FFD700;
}

.sponsor-card:hover {
    border-color: #FFA500;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.product-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212529;
}

.product-description {
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 15px 0;
    flex-grow: 1;
}

.product-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.product-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.product-link {
    color: #003545;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.product-link:hover {
    color: #005570;
    text-decoration: underline;
}

.details-btn {
    background: #003545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
    font-family: inherit;
}

.details-btn:hover {
    background: #005570;
}

/* Expanded Product Details */
.product-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.product-details h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #212529;
}

.product-details h4:first-child {
    margin-top: 0;
}

.product-details p {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 15px;
}

.product-details ul {
    margin: 10px 0 15px 20px;
    color: #495057;
}

.product-details li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.product-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.product-links a {
    color: #003545;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid #003545;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.product-links a:hover {
    background: #003545;
    color: white;
}

/* Expanded Card State */
.product-card.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    border-color: #003545;
    z-index: 1000;
    animation: cardExpand 0.3s ease forwards;
}

.product-card.collapsing {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 800px;
    z-index: 1000;
    animation: cardCollapse 0.25s ease forwards;
}

@keyframes cardExpand {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes cardCollapse {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
}

.product-card.expanded .product-link {
    display: none;
}

.product-card.expanded .product-actions {
    order: 99;
    justify-content: flex-end;
    margin-top: 0;
    padding-top: 0;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-overlay.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-top {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
    }

    .header-right {
        align-items: center;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero__content {
        padding: 40px 0 60px;
    }

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

    .hero p {
        font-size: 1.1rem;
    }
    
    .category-menu-toggle {
        display: flex;
    }

    .category-filter-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .category-filter-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 10px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .category-filter-container.open {
        max-height: 500px;
    }

    /* Hamburger to X animation */
    .category-menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .category-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .category-menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .category-btn {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .details-btn {
        width: 100%;
    }

    .product-card.expanded .product-actions {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-top: 15px;
    }

    .product-card.expanded .details-btn {
        width: auto;
    }

    .product-card.expanded .product-links {
        justify-content: center;
    }

    .sponsor-badge {
        position: static;
        margin-bottom: 15px;
        display: inline-block;
    }

    .tag-filter-bar {
        padding: 0 20px;
    }

    .tag-filter-bar .tag-filter-container.open {
        max-height: none;
        padding-bottom: 12px;
    }

    .tag-filter-container {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .tag-filter-container.open {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #adb5bd transparent;
        padding-bottom: 4px;
    }

    .tag-filter-container::-webkit-scrollbar {
        height: 4px;
    }

    .tag-filter-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .tag-filter-container::-webkit-scrollbar-thumb {
        background: #adb5bd;
        border-radius: 2px;
    }

    .tag-filter-btn {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    .tag-filter-clear {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .product-card {
        padding: 20px;
    }

    .header-logo img {
        height: 40px;
    }

    .header-btn {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .header-social-link svg {
        width: 14px;
        height: 14px;
    }
}