/*@import url('../../shared/global.css');*/

/* Search Page Layout */
#search-page-container {
    display: flex;
    width: 100%;
    max-width: 1600px; /* Wider container for search page */
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px; /* Add some padding for smaller screens */
}
body.preload-hidden #main-content,
body.preload-hidden #categories-filter,
body.preload-hidden #categories-dropdown-container,
body.preload-hidden #search-bar-main {
    opacity: 0;
    pointer-events: none; /* Optional, prevent clicks */
}

#sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--new-card-bg);
    border: 1px solid var(--new-border);
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

#main-content {
    flex-grow: 1;
    min-width: 0;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--new-text-header);
    margin-bottom: 15px;
}

.filter-options a {
    display: block;
    padding: 8px 0;
    color: var(--new-text-sub);
    text-decoration: none;
    transition: color 0.3s ease;
}

.filter-options a:hover {
    color: #0070f3;
}

#search-bar-main {
    flex-grow: 1; /* Allow search bar to take available space */
    margin-bottom: 40px; /* Remove auto margin to align left */
    display: flex;
}

#search-bar-main input {
    flex-grow: 1;
    border: 1px solid var(--new-border);
    border-radius: 8px 0 0 8px;
    padding: 15px 20px;
    font-size: 1.1rem;
    outline: none;
    background: var(--bg-color);
    color: var(--text-primary);
}

#search-bar-main button {
    padding: 0 25px;
    border: 1px solid var(--new-border);
    border-left: none;
    background: #0070f3;
    color: white;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1.2rem;
}

.search-and-filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .search-and-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
}

#search-bar-main {
    margin-bottom: 0; /* Remove margin from search bar itself */
}

.filter-popup-container {
    position: relative;
}

#filter-by-btn {
    padding: 12px 20px; /* Reduced vertical padding */
    background-color: var(--new-card-bg);
    border: 1px solid var(--new-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

#filter-popup-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background-color: var(--new-card-bg);
    border: 1px solid var(--new-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 10;
    width: 200px;
}

#filter-popup-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
}

#filter-popup-menu a:hover {
    background-color: var(--new-light-bg);
}

.main-content-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--new-text-header);
    margin-bottom: 30px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 20px;
    background: linear-gradient(135deg, #0070f3, #0052d4);
    color: white;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.5rem;
    max-width: 700px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

#search-bar {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

#search-bar input {
    flex-grow: 1;
    border: none;
    border-radius: 12px 0 0 12px;
    padding: 20px;
    font-size: 1.2rem;
    outline: none;
}

#search-bar button {
    padding: 0 30px;
    border: none;
    background: #ff4081;
    color: white;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

#search-bar button:hover {
    background: #e0346e;
}

/* Featured APIs Section */
.featured-apis {
    padding: 80px 20px;
    background: var(--bg-color);
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 60px;
    color: var(--text-primary);
}


/* How It Works Section */
.how-it-works {
    padding: 80px 20px;
    background: var(--section-bg);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.step-icon {
    font-size: 3.5rem;
    color: #0070f3;
    margin-bottom: 20px;
}

.step-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.step-card p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Call to Action Section */
.cta-section {
    padding: 100px 20px;
    background: linear-gradient(135deg, #ff4081, #ff79b0);
    text-align: center;
    color: white;
}

.cta-section h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.cta-button {
    background: white;
    color: #ff4081;
    padding: 18px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}





.loading, .no-apis, .error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}

.error {
    color: #e74c3c;
}

.error button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #6c63ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.error button:hover {
    background-color: #564fd4;
}

/* Estilo para el logo en las tarjetas */
.api-card-header .logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

/* Estilos de paginación */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--new-border);
    background-color: var(--new-card-bg);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--new-light-bg);
    border-color: #0070f3;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: #0070f3;
    color: white;
    border-color: #0070f3;
}

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

.pagination-ellipsis {
    padding: 8px 5px;
    color: var(--text-secondary);
}

.page-info {
    margin-left: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-numbers {
        justify-content: center;
    }
    
    .page-info {
        text-align: center;
        margin: 10px 0 0 0;
    }
}

/* Hide dropdown on desktop */
#categories-dropdown-container {
    display: none;
}

/* Show dropdown only on mobile */
@media (max-width: 768px) {
    #sidebar {
        display: none; /* hide sidebar */
    }

    #categories-dropdown-container {
        display: block;
        width: 100%;
        position: relative;
    }

    #categories-dropdown-btn {
        width: 100%;
        padding: 12px 16px;
        border: 1px solid var(--new-border);
        border-radius: 8px;
        background: var(--new-card-bg);
        color: var(--text-primary);
        font-weight: 600;
        text-align: left;
        cursor: pointer;
    }

    #categories-dropdown-menu {
        position: absolute;
        top: 110%;
        left: 0;
        right: 0;
        background: var(--new-card-bg);
        border: 1px solid var(--new-border);
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 100;
    }

    #categories-dropdown-menu a {
        display: block;
        padding: 10px 16px;
        text-decoration: none;
        color: var(--text-primary);
    }

    #categories-dropdown-menu a:hover {
        background: var(--new-light-bg);
    }
}

.category-separator {
    border: none;
    height: 1px;
    background-color: #e1e5e9;
    margin: 10px 0;
}

.all-categories-link {
    font-weight: 600;
    color: #2c3e50 !important;
}

.active-category {
    background-color: #f8f9fa;
    font-weight: 600;
    border-left: 3px solid #007bff;
    padding-left: 12px !important;
}

[data-theme="dark"] .category-separator {
    background-color: #444;
}

[data-theme="dark"] .all-categories-link {
    color: #ecf0f1 !important;
}

[data-theme="dark"] .active-category {
    background-color: #34495e;
    border-left-color: #3498db;
}
