/**
 * Advanced Portfolio System CSS
 * Enhanced filtering, sorting, and search controls
 */

/* Portfolio Controls Container */
.portfolio-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0 3rem;
    padding: 2rem;
    background: var(--hero-gradient);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

/* Enhanced Filter Buttons */
.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgb(255, 152, 0);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    color: ##040404;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3182ce;
    background: rgba(49, 130, 206, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #ff9800;
    color: black;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.filter-icon {
    font-size: 1.1em;
    opacity: 0.9;
}

.filter-text {
    font-weight: 600;
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.filter-btn:not(.active) .filter-count {
    background: rgba(0, 0, 0, 0.1);
    color: #6b7280;
}

/* Right Side Controls */
.portfolio-controls-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Sort Dropdown */
.portfolio-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.sort-label svg {
    opacity: 0.7;
}

.sort-select {
    padding: 0.6rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    min-width: 140px;
}

.sort-select:hover,
.sort-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* View Toggle */
.portfolio-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 0.25rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle-btn:hover {
    color: #4a5568;
    background: rgba(0, 0, 0, 0.05);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Search Input */
.portfolio-search {
    position: relative;
    min-width: 250px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

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

.search-input:hover {
    border-color: #cbd5e0;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.search-input-wrapper.focused .search-icon {
    color: #667eea;
    transform: scale(1.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-clear:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

/* Results Info */
.portfolio-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

.results-count {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.9rem;
}

.results-count #visible-count {
    color: #667eea;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.clear-filters-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* List View Styles */
.portfolio-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.portfolio-grid.list-view .portfolio-item {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.portfolio-grid.list-view .portfolio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.portfolio-grid.list-view .portfolio-image {
    flex: 0 0 300px;
    height: 200px;
    position: relative;
}

.portfolio-grid.list-view .portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-grid.list-view .portfolio-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portfolio-grid.list-view .portfolio-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

/* No Results Message */
.no-results-message {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: #6b7280;
    grid-column: 1 / -1;
}

.no-results-content {
    max-width: 400px;
    padding: 2rem;
}

.no-results-content svg {
    margin: 0 auto 1.5rem;
    opacity: 0.6;
}

.no-results-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.no-results-content p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-controls {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .portfolio-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .portfolio-controls-right {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .portfolio-sort {
        justify-content: space-between;
    }
    
    .sort-select {
        min-width: 120px;
    }
    
    .portfolio-search {
        min-width: auto;
    }
    
    .portfolio-results-info {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .portfolio-grid.list-view .portfolio-item {
        flex-direction: column;
    }
    
    .portfolio-grid.list-view .portfolio-image {
        flex: none;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .filter-count {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .portfolio-controls-right {
        flex-direction: column;
        align-items: center;
    }
    
    .portfolio-view-toggle {
        align-self: center;
    }
}

/* Loading Animation */
@keyframes portfolioItemLoad {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.portfolio-item {
    animation: portfolioItemLoad 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Enhanced Transitions */
.portfolio-grid {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus Styles for Accessibility */
.filter-btn:focus,
.sort-select:focus,
.search-input:focus,
.view-toggle-btn:focus,
.clear-filters-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .portfolio-controls {
        border: 2px solid #000;
        background: #fff;
    }
    
    .filter-btn {
        border: 2px solid #000;
        background: #fff;
    }
    
    .filter-btn.active {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .portfolio-item,
    .filter-btn,
    .search-input,
    .sort-select {
        transition: none;
        animation: none;
    }
    
    .filter-btn:hover,
    .portfolio-item:hover {
        transform: none;
    }
}