/* Portfolio Specific Styles */

/* Container and Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Enhanced Filter Buttons - Mobile First */
.portfolio-filters {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-height: 44px; /* Improved touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    position: relative;
    overflow: hidden;
}

.filter-btn.active {
    background-color: #0F9D58;
    color: white;
    border-color: #0F9D58;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: scale(1.02);
}

/* Add colored text effect for active categories */
.filter-btn.active i {
    color: rgba(255, 255, 255, 0.9);
}

.filter-btn:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Mobile Filter Layout */
@media (max-width: 640px) {
    .portfolio-filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);        gap: 0.75rem;
        margin: 0 auto;
        max-width: 320px;
    }
    
    .filter-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        min-width: unset;
        max-width: unset;
        flex: unset;
    }
    
    .filter-btn i {
        margin-right: 0.25rem;
    }
}

/* Enhanced View Toggle */
.view-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.view-toggle-wrapper {
    background-color: #f3f4f6;
    padding: 0.25rem;
    border-radius: 0.75rem;
    display: flex;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.view-toggle-btn {
    padding: 0.75rem 1.25rem;
    color: #6b7280;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    min-height: 44px; /* Better touch target */
    min-width: 80px;
    font-weight: 500;
    gap: 0.5rem;
}

.view-toggle-btn.active {
    background-color: white;
    color: #0F9D58;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.view-toggle-btn:hover {
    color: #0F9D58;
}

.view-toggle-btn i {
    font-size: 1.125rem;
}

/* Responsive View Toggle */
@media (max-width: 768px) {
    .view-toggle-container {
        margin-top: 1rem;
    }
    
    .view-toggle-wrapper {
        width: 100%;
        max-width: 160px;
        padding: 0.2rem;
    }
    
    .view-toggle-btn {
        padding: 0.625rem;
        min-width: 50%;
        font-size: 0.875rem;
    }
    
    .view-toggle-btn span {
        display: none;
    }
    
    .view-toggle-btn i {
        font-size: 1rem;
        margin: 0;
    }
}

/* Portfolio Cards - Mobile First Responsive */
.portfolio-card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    width: 100%;
}

.portfolio-card:hover {
    border-color: #0F9D58;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-8px) scale(1.02);
}

.portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.1);
}

.portfolio-card-image {
    position: relative;
    overflow: hidden;
    height: 180px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Desktop hover effects */
@media (min-width: 768px) {
    .portfolio-card:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .portfolio-card-image {
        height: 220px;
    }
}

.portfolio-card-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-card:hover .portfolio-card-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

.portfolio-card-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    gap: 0.75rem;
}

.portfolio-card:hover .portfolio-card-actions {
    opacity: 1;
}

.portfolio-action-btn {
    width: 3rem;
    height: 3rem;
    background-color: white;
    color: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: scale(1);
}

.portfolio-action-btn:hover {
    background-color: #0F9D58;
    color: white;
    transform: scale(1.1);
}

.portfolio-card-content {
    padding: 1.5rem;
}

.portfolio-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.portfolio-card-title:hover {
    color: #0F9D58;
}

.portfolio-card-description {
    color: #4b5563;    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-tag {
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    color: #374151;
    font-size: 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.portfolio-tag.primary {
    background-color: rgba(15, 157, 88, 0.1);
    color: #0F9D58;
}

.portfolio-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Portfolio Stats */
.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .portfolio-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.portfolio-stat {
    text-align: center;
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.portfolio-stat-number {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.portfolio-stat-label {
    color: #4b5563;
    font-size: 0.875rem;
}

/* Loading Animation */
.portfolio-skeleton {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

.skeleton-image {
    height: 13rem;
    background-color: #e5e7eb;
}

.skeleton-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-line {
    height: 1rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
}

.skeleton-line.short {
    width: 75%;
}

.skeleton-line.long {
    width: 100%;
}

/* Filter Animation */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.portfolio-item.filtered-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.portfolio-item.filtered-in {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Enhanced Filter and Search Styles */
/* Search Input Enhancements */
#portfolioSearch {
    transition: all 0.3s ease;
}

#portfolioSearch:focus {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(15, 157, 88, 0.2);
}

/* Featured Badge */
.portfolio-item .absolute {
    backdrop-filter: blur(4px);
}

/* Enhanced Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item-enter {
        animation: slideInUp 0.6s ease-out forwards;
}

/* Filter Button Enhancements */
.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0F9D58 0%, #34D399 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-btn.active::before {
    opacity: 1;
}

.filter-btn span,
.filter-btn i {
    position: relative;
    z-index: 10;
}

/* Stats Cards Enhancement */
.bg-white:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Load More Button */
#loadMoreBtn {
    transform: scale(1);
    transition: all 0.3s ease;
}

#loadMoreBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #0F9D58 0%, #34D399 100%);
}

/* List View Specific Styles */
.portfolio-grid-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.portfolio-card-list {
    display: flex;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.portfolio-card-list:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.portfolio-card-list .portfolio-card-image {
    width: 33.333333%;
    flex-shrink: 0;
}

.portfolio-card-list .portfolio-card-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive Enhancements */
@media (max-width: 640px) {
    .portfolio-filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .view-toggle-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .portfolio-card-list {
        flex-direction: column;
    }
    
    .portfolio-card-list .portfolio-card-image {
        width: 100%;
        height: 12rem;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .view-toggle-btn {
        color: #d1d5db;
    }
    
    .view-toggle-btn.active {
        background-color: #374151;
        color: #0F9D58;
    }
    
    #portfolioSearch {
        background-color: #1f2937;
        border-color: #4b5563;
        color: white;
    }
    
    #portfolioSearch::placeholder {
        color: #9ca3af;
    }
    
    .portfolio-card-list {
        background-color: #1f2937;
    }
}
