/* Category Section Styles */
.filter-section {
    width: 100%;
    margin: 4rem 0;
    padding: 0 7rem; /* Add padding for proper spacing */
    box-sizing: border-box;
    position: relative;
}

.category-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping to multiple lines */
    gap: 12px;
    padding: 2rem; /* Generous padding for the category area */
    background-color: var(--input-background); 
    border-radius: 15px; /* Rounded container */
    margin-top: 1.5rem; /* Space between title and categories */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

/* Category header styling */
.category-header {
    text-align: center;
    margin-bottom: 0;
}

.category-header h2 {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--text-color);
    margin: 0;
    font-weight: 700;
}

.category-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: var(--color-secondary);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-width: fit-content;
}

.category-btn:hover {
    background: var(--color-secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background: var(--color-alert); /* Different color for selected category */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 121, 100, 0.3); /* Primary color shadow */
    font-weight: 600; /* Slightly bolder for active state */
}

.category-btn.active:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

/* Add subtle shine effect on active button */
.category-btn.active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    20%, 100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.category-header {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
    margin-bottom: 20px;
    gap: 2rem;
}

/* Search Bar Styles */
.search-container {
    position: relative;
    max-width: 500px;
    width: 100%;
    align-self: center;
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color-light);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.clear-search:hover {
    color: var(--text-color);
}

/* Show clear button when search has content */
.search-input:not(:placeholder-shown) + .clear-search {
    display: block;
}

/* Category Events Grid with Animations */
.category-events-section {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.category-events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    place-self: center;
    margin-bottom: 40px;
    margin-top: 20px;
    width: 100%;
    max-width: 1200px;
}

/* Category Card Animations */
/* Cyberpunk Styled Category Event Card */
/* Animation for card appearance - kept here for use by multiple components */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation delay for cards - kept here for use by multiple components */
.event-card-base:nth-child(1) { animation-delay: 0s; }
.event-card-base:nth-child(2) { animation-delay: 0.1s; }
.event-card-base:nth-child(3) { animation-delay: 0.2s; }
.event-card-base:nth-child(4) { animation-delay: 0.3s; }
.event-card-base:nth-child(5) { animation-delay: 0.4s; }
.event-card-base:nth-child(6) { animation-delay: 0.5s; }
.event-card-base:nth-child(7) { animation-delay: 0.6s; }
.event-card-base:nth-child(8) { animation-delay: 0.7s; }

/* Note: All other event card styles have been moved to the global component at:
 * /components/event-card.css
 */

/* Responsive Design - Updated for better scaling */
@media (min-width: 1600px) {
    .category-events-grid {
        gap: 25px;
    }
}

@media (max-width: 1100px) {
    .category-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (max-width: 900px) {
    .category-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Remove secondary and tertiary styling for desktop - all buttons should look the same */

/* Expand/collapse toggle button */
.category-expand-toggle {
    text-align: center;
    margin-top: 1rem;
    display: none; /* Hidden by default, shown on mobile */
}

.category-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.category-expand-btn:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
}

.category-expand-btn i {
    transition: transform 0.3s ease;
}

.category-expand-btn.expanded i {
    transform: rotate(180deg);
}

/* Mobile styles */
@media (max-width: 768px) {
    .filter-section {
        padding: 0 1rem;
    }
    
    .category-events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-buttons {
        justify-content: center;
        padding: 0.8rem;
        margin: 0;
        width: 100%;
        max-height: 85px; /* Show approximately first row */
        gap: 6px; /* Reduced gap for more buttons per row */
    }

    .category-buttons.expanded {
        max-height: none; /* Show all categories when expanded */
    }

    .category-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        margin: 1px;
        min-width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .category-header h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    /* Show expand button on mobile */
    .category-expand-toggle {
        display: block;
    }

    /* Hide secondary and tertiary buttons initially on mobile */
    .category-btn-secondary,
    .category-btn-tertiary {
        opacity: 0.4;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    /* Show all buttons when expanded - same opacity for consistency */
    .category-buttons.expanded .category-btn-secondary,
    .category-buttons.expanded .category-btn-tertiary {
        opacity: 1;
        pointer-events: auto;
    }

    .category-title {
        white-space: nowrap;
    }

    /* Only override what's necessary for category page cards in mobile view */
    .event-card-base {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
        margin-bottom: 20px;
        min-height: 180px; /* Set minimum height for the card */
        flex-direction: row;
    }

    /* Mobile-specific clip path is now handled in the main component */

    .category-card-wrapper {
        background: var(--card-background);
        color: var(--text-color);
        height: 100%;
        display: flex;
        flex-direction: column;
        position: relative;
        clip-path: polygon(
            0px 25px,              /* Top left corner */
            26px 0px,              /* Top left diagonal */
            calc(37% - 25px) 0px,  /* Top line start */
            calc(42% - 25px) 10%,  /* Top notch */
            100% 10%,              /* Top right corner */
            100% calc(100% - 10px), /* Bottom right corner */
            calc(100% - 15px) calc(100% - 10px),   /* Bottom right notch */
            calc(80% - 10px)  calc(100% - 10px),   /* Bottom line start */
            calc(80% - 15px) calc(100% - 0px),     /* Bottom notch */
            10px  calc(100% - 0px), /* Bottom left corner */
            0% calc(100% - 10px)    /* Bottom line end */
         );
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    
    .category-card-wrapper a {
        text-decoration: none;
        color: inherit;
        height: 100%;
        display: flex;
        flex-direction: row;
    }
    
    .category-event-image {
        width: 35%;
        height: auto;
        margin: 0;
        border-radius: 8px 0 0 8px;
    }

    .category-event-details {
        width: 65%;
        padding: 8px;
        display: flex;
        flex-direction: column;
        height: 80%;
        gap: calc(2px + 0.3vw);
        align-self: center;
    }

    .category-event-details h3 {
        margin: 0 0 5px 0;
        font-size: 1rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 3rem;
        color: var(--text-color);
        transition: color 0.3s ease;
    }

    .category-event-date,
    .category-event-location {
        font-size: 0.9rem;
        margin: 2px 0;
        color: var(--text-color-light);
        transition: color 0.3s ease;
    }

    .category-event-categories {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        max-height: 28px; /* Limit to approximately one row */
        overflow: hidden;
        margin-top: 4px;
    }

    .category-events-section {
        width: calc(100% - 20px);
        padding: 0;
    }

    .category-events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .category-events-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.page-nav {
    padding: 10px 20px;
    border: none;
    background: var(--color-secondary);
    color: var(--background-color);
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.page-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 10px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-secondary);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number.active {
    background: var(--color-secondary);
    color: var(--background-color);
}
