/* Open-Source Tools and Code Library Styles */

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

/* Header Section */
.tools-header {
    text-align: center;
    margin-bottom: 40px;
}

.tools-header h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 15px;
}

.tools-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Search and Filter Section */
.tools-search-section {
    margin-bottom: 40px;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto 20px;
}

.search-bar input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

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

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

/* Filter Rows */
.filter-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.filter-row.level-1 {
    margin-bottom: 10px;
}

.filter-row.level-2 {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.sub-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Level 1 Filter Tags (Main Categories) */
.filter-tag {
    padding: 12px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid #468EA6;
    border-radius: 8px;
    background-color: white;
    color: #468EA6;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-tag:hover {
    background-color: #f0f7f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(70, 142, 166, 0.2);
}

.filter-tag.active {
    background-color: #468EA6;
    color: white;
    box-shadow: 0 4px 12px rgba(70, 142, 166, 0.3);
}

/* Level 2 Filter Tags (Sub-categories) */
.filter-tag-sub {
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid #7DBA87;
    border-radius: 6px;
    background-color: white;
    color: #7DBA87;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-tag-sub:hover {
    background-color: #f0f9f3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(125, 186, 135, 0.2);
}

.filter-tag-sub.active {
    background-color: #7DBA87;
    color: white;
    box-shadow: 0 3px 8px rgba(125, 186, 135, 0.3);
}

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

/* Tool Card */
.tool-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.tool-title {
    font-size: 1.4rem;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

/* Tool Tags */
.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

/* Language Tags */
.tag-python {
    background-color: #3776ab;
}

.tag-r {
    background-color: #276dc3;
}

.tag-cpp {
    background-color: #659ad2;
}

.tag-javascript {
    background-color: #f7df1e;
    color: #333;
}

/* Tech Tags */
.tag-ml {
    background-color: #ff6b6b;
}

.tag-dl {
    background-color: #ee5a6f;
}

.tag-gis {
    background-color: #51cf66;
}

.tag-model {
    background-color: #845ef7;
}


/* Category Tags */
.tag-tool {
    background-color: var(--color-primary);
}

.tag-code {
    background-color: var(--color-primary-dark);
}

.tag-foundational {
    background-color: var(--color-success);
}

/* Subcategory Tags */
.tag-sub {
    background-color: #7DBA87;
}

/* Tool Description */
.tool-description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Tool Actions */
.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    align-items: center;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    flex: 1;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

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

.page-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.page-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

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

.page-ellipsis {
    color: #999;
    padding: 0 5px;
}

/* Contribute Section */
.contribute-section {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    margin-top: 60px;
}

.contribute-section h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.contribute-section p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-contribute {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--color-accent);
    color: var(--color-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-contribute:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 39, 76, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }

    .tools-header h1 {
        font-size: 2rem;
    }

    .contribute-section h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .tools-container {
        padding: 30px 15px;
    }

    .tools-header h1 {
        font-size: 1.75rem;
    }

    .tools-description {
        font-size: 1rem;
    }

    .filter-controls {
        gap: 15px;
    }

    .filter-tag {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .filter-tag-sub {
        padding: 7px 14px;
        font-size: 0.875rem;
    }

    .filter-row {
        gap: 10px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tool-actions {
        flex-direction: column;
    }

    .contribute-section {
        padding: 40px 15px;
    }

    .contribute-section h2 {
        font-size: 1.5rem;
    }

    .contribute-section p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .search-bar input {
        padding: 12px 45px 12px 15px;
        font-size: 0.95rem;
    }

    .tool-title {
        font-size: 1.2rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
