@import url("style.css");

.project-grid{
    display: grid;
    padding: 20px;
    gap: 15px;
    margin: 20px 0;
    grid-template-columns: 33.3% 33.3% 33.3%;
    /* min-height: 100vh; */
    background-color: var(--bg--dark);
    /* border: 5px solid var(--border-muted);*/
    border-radius: 10px; 
}


.project-card{
    min-width: 16rem;
    background-color: var(--bg);
    padding: 20px;
    transition: all 0.3s ease-in-out;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.project-card:hover,
.project-card:focus {
    min-width: 16rem;
    background-color: var(--bg-light);
    scale: 1.03;
    transition: all 0.3s ease-in-out;
    outline: none;
}

.project-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.project-card img{
    width: 100%;
    height: 200px;
    border-radius: 10px;
    bottom: 0;
    margin: 0;
    object-fit: cover;
    display: flex;
    
}
.project-card h5{
    margin-left: 10px;
    margin-top: 10px;
    margin-bottom: 0;
    color: var(--text-muted);
    
}
.project-card:hover .tag{
    background-color: var(--primary);
}

.katex-html {
    display: none;
}

.tag{
    background-color: var(--bg-light);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 5px;
    margin: 0;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.active_tag{
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.active_tag:hover{
    background-color: var(--danger);
    border-color: var(--danger);
}

/* Card tags container */
.card-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Tags on cards */
.card-tag {
    font-size: 0.85rem;
    padding: 4px 10px;
}

.card-tag:hover {
    transform: translateY(-1px);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

#search {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0;
    font-size: 1rem;
    background-color: var(--bg);
    color: var(--text);
    transition: all 0.3s ease;
}

#search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 77, 72, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    color: var(--text);
    background-color: var(--bg-light);
}

/* Filter Section */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.clear-filters-btn {
    padding: 8px 16px;
    background-color: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Results Count */
.results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.results-count.no-results {
    color: var(--danger);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loading-indicator p {
    margin: 0;
}

/* Error Message */
.error-message {
    background-color: rgba(212, 77, 72, 0.1);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1rem;
    color: var(--danger);
    margin-bottom: 1rem;
    text-align: center;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    grid-column: 1 / -1;
}

.no-results-message h2 {
    margin-bottom: 0.5rem;
}

.no-results-message p {
    margin: 0;
}

/* Responsive styles */
@media (max-width: 1250px) {
    .project-grid{
        grid-template-columns: 50% 50%;
    }
}

@media (max-width: 800px) {
    .project-grid{
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .project-card {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 0;
        box-sizing: border-box;
    }
    
    .project-card h3 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .project-card p {
        font-size: 1rem;
        line-height: 1.6rem;
    }
    
    .project-card img {
        height: 180px;
        margin-top: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .search-container {
        margin-bottom: 1rem;
    }
    
    #search {
        padding: 10px 40px 10px 12px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tags-container {
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
    }
}

/* Responsive styles for very small screens (iPhone SE: 375px) */
@media (max-width: 400px) {
    .project-grid {
        padding: 10px;
        gap: 12px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    .project-card {
        padding: 12px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .project-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
    }
    
    .project-card p {
        font-size: 0.95rem;
        line-height: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .project-card img {
        height: 160px;
        width: 100%;
        max-width: 100%;
        display: block;
    }
    
    .project-card h5 {
        font-size: 0.9rem;
        margin-top: 8px;
        margin-left: 0;
    }
    
    .tag {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    .card-tag {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    .card-tags-container {
        margin: 0.5rem 0;
    }
}
