/* ============================================
   VHASS - Works & Blog Shared Styles
   iFixit-inspired clean card design
   ============================================ */

/* ============================================
   FILTER SECTION
   ============================================ */
.filter-section {
    background-color: #f9fafb;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.625rem 1.25rem;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: capitalize;
}

.filter-btn:hover {
    border-color: #0071CE;
    color: #0071CE;
    background-color: #f0f9ff;
}

.filter-btn.active {
    background-color: #0071CE;
    border-color: #0071CE;
    color: #ffffff;
}

.filter-btn:focus-visible {
    outline: 2px solid #0071CE;
    outline-offset: 2px;
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    position: relative;
    min-width: 280px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #0071CE;
    box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* ============================================
   RESULTS INFO
   ============================================ */
.results-info {
    margin-top: 1.5rem;
}

.results-count {
    color: #6b7280;
    font-size: 0.875rem;
}

.results-count span {
    font-weight: 600;
    color: #374151;
}

/* ============================================
   WORKS & BLOG GRID
   ============================================ */
.works-section,
.blog-section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-20);
}

.works-grid,
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 2rem;
}

/* ============================================
   CARD STYLES
   ============================================ */
.work-card,
.blog-card {
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.work-card:hover,
.blog-card:hover {
    border-color: #0071CE;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* ============================================
   CARD IMAGES
   ============================================ */
.work-image,
.blog-image {
    width: 100%;
    aspect-ratio: 3/2;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    overflow: hidden;
    position: relative;
}

.work-image img,
.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-card:hover .work-image img,
.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

/* ============================================
   CARD CONTENT
   ============================================ */
.work-content,
.blog-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

/* ============================================
   BADGES
   ============================================ */
.work-badge,
.blog-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

/* Work Badges */
.work-badge-project {
    background-color: #dbeafe;
    color: #1e40af;
}

.work-badge-prototype {
    background-color: #fef3c7;
    color: #92400e;
}

.work-badge-product {
    background-color: #d1fae5;
    color: #065f46;
}

/* Blog Badges */
.blog-badge-hardware {
    background-color: #dbeafe;
    color: #1e40af;
}

.blog-badge-software {
    background-color: #d1fae5;
    color: #065f46;
}

.blog-badge-embedded {
    background-color: #fef3c7;
    color: #92400e;
}

/* ============================================
   CARD TEXT
   ============================================ */
.work-title,
.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}

.work-description,
.blog-excerpt {
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0;
}

/* ============================================
   BLOG META
   ============================================ */
.blog-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.blog-read-time::before {
    content: '📖';
    margin-right: 0.25rem;
}

.blog-date::before {
    content: '📅';
    margin-right: 0.25rem;
}

/* ============================================
   CARD LINKS
   ============================================ */
.work-link,
.blog-link {
    color: #0071CE;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    display: inline-block;
}

.work-link:hover,
.blog-link:hover {
    color: #005AA3;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.empty-icon {
    margin: 0 auto 1.5rem;
    color: #d1d5db;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-text {
    color: #6b7280;
    font-size: 1rem;
}

/* ============================================
   FADE ANIMATIONS
   ============================================ */
.work-card,
.blog-card {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-card.fade-out,
.blog-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.work-card.fade-in,
.blog-card.fade-in {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .works-grid,
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .filter-section {
        padding: 2rem 0;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .works-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .work-card,
    .blog-card {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .filter-btn {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .work-title,
    .blog-title {
        font-size: 1.125rem;
    }
    
    .work-description,
    .blog-excerpt {
        font-size: 0.875rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .filter-section,
    .whatsapp-float,
    .footer {
        display: none;
    }
    
    .work-card,
    .blog-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border-color: #000;
    }
}


/* ============================================
   DROPDOWN FILTERS
   ============================================ */
.filter-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.filter-dropdown {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    appearance: none;
}

.filter-dropdown:hover {
    border-color: #0071CE;
}

.filter-dropdown:focus {
    outline: none;
    border-color: #0071CE;
    box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.1);
}

/* Remove old button styles if still present */
.filter-buttons {
    display: none;
}

@media (max-width: 768px) {
    .filter-dropdowns {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .dropdown-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        width: 100%;
    }
}
