/* Portfolio Section Styles */
#portfolio {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    width: 100%;
    position: relative;
    overflow: hidden;
}

#portfolio::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

#portfolio::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.portfolio-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Section Header */
.portfolio-header {
    text-align: center;
    margin-bottom: 60px;
}

.portfolio-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.2;
    background: linear-gradient(135deg, #1f2937 0%, rgb(29, 78, 216) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Filter Container */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.1), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    border-color: rgb(29, 78, 216);
    color: rgb(29, 78, 216);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.filter-btn.active {
    background: rgb(29, 78, 216);
    border-color: rgb(29, 78, 216);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.3);
}

.filter-icon {
    font-size: 1.1rem;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: rgba(29, 78, 216, 0.1);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* Portfolio Card */
.portfolio-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

.portfolio-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.portfolio-card.filtered-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
}

.portfolio-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(29, 78, 216, 0.2);
    border-color: rgb(29, 78, 216);
}

/* Card Badge */
.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(59, 130, 246) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Image */
.card-image {
    height: 260px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card:hover .card-image img {
    transform: scale(1.15) rotate(2deg);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .image-overlay {
    opacity: 1;
}

.category-label {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card Content */
.card-content {
    padding: 25px;
}

.card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
}

.meta-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.portfolio-card:hover .card-title {
    color: rgb(29, 78, 216);
}

.card-desc {
    color: #6b7280;
    line-height: 1.7;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
}

/* Card Stats */
.card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: rgb(29, 78, 216);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(37, 99, 235) 100%);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.portfolio-card:hover .card-overlay {
    top: 0;
}

.overlay-content {
    text-align: center;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;
}

.portfolio-card:hover .overlay-content {
    opacity: 1;
    transform: translateY(0);
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* View Project Button */
.view-project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: rgb(29, 78, 216);
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.view-project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.2), transparent);
    transition: left 0.5s ease;
}

.view-project-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

.view-project-btn:hover::before {
    left: 100%;
}

.btn-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.view-project-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* View All Projects Button */
.portfolio-actions {
    text-align: center;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(37, 99, 235) 100%);
    color: white;
    border: none;
    padding: 18px 48px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(29, 78, 216, 0.3);
}

.view-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.view-all-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(29, 78, 216, 0.4);
}

.view-all-btn:hover::before {
    left: 100%;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.view-all-btn:hover .btn-arrow {
    transform: translateX(6px);
}

.portfolio-footer-text {
    margin-top: 20px;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .portfolio-title {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-container {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    #portfolio {
        padding: 60px 0;
    }
    
    .portfolio-title {
        font-size: 2.5rem;
    }
    
    .portfolio-subtitle {
        font-size: 1.1rem;
    }
    
    .portfolio-header {
        margin-bottom: 40px;
    }
    
    .filter-container {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .filter-icon {
        font-size: 1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .card-image {
        height: 220px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-stats {
        gap: 10px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .card-overlay {
        padding: 25px;
    }
    
    .view-all-btn {
        padding: 16px 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .portfolio-container {
        padding: 0 15px;
    }
    
    .portfolio-title {
        font-size: 2rem;
    }
    
    .portfolio-subtitle {
        font-size: 1rem;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        justify-content: center;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .project-tags {
        gap: 6px;
    }
    
    .tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .view-project-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .view-all-btn {
        padding: 14px 32px;
        width: 100%;
    }
    
    .portfolio-footer-text {
        font-size: 0.85rem;
    }
}

/* Keyboard Navigation Styles */
.keyboard-nav .portfolio-card:focus,
.keyboard-nav .view-project-btn:focus,
.keyboard-nav .view-all-btn:focus,
.keyboard-nav .filter-btn:focus {
    outline: 3px solid rgb(29, 78, 216);
    outline-offset: 3px;
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.portfolio-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}