/* Modern Portfolio Styles */

.portfolio {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.portfolio-container {
    position: relative;
    z-index: 2;
}

/* Modern Portfolio Header */
.portfolio-header {
    text-align: center;
    margin-bottom: 80px;
}

.portfolio-header h2 {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.portfolio-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 2px;
}

.portfolio-subtitle {
    font-size: 1.2rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Modern Filter Navigation */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 60px;
}

.portfolio-filter {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    color: #4a5568;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-filter:hover,
.portfolio-filter.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Modern Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Modern Portfolio Card */
.portfolio-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.portfolio-card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.1);
}

.portfolio-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-card:hover .portfolio-card-overlay {
    opacity: 1;
}

.portfolio-card-overlay-content {
    text-align: center;
    color: white;
}

.portfolio-view-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.portfolio-view-btn:hover {
    background: white;
    color: #667eea;
}

.portfolio-card-content {
    padding: 30px;
}

.portfolio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.portfolio-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    line-height: 1.3;
}

.portfolio-card-year {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.portfolio-card-category {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.portfolio-card-description {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.portfolio-card-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.portfolio-tech-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.portfolio-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portfolio-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.portfolio-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.portfolio-status-indicator.active {
    background: #48bb78;
    box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
}

.portfolio-status-indicator.completed {
    background: #667eea;
}

.portfolio-status-indicator.archived {
    background: #a0aec0;
}

.portfolio-card-links {
    display: flex;
    gap: 10px;
}

.portfolio-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.portfolio-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Filter Animation */
.portfolio-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.portfolio-card.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Loading Animation */
.portfolio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.portfolio-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio {
        padding: 60px 0;
    }
    
    .portfolio-header h2 {
        font-size: 2.2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }
    
    .portfolio-filters {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .portfolio-filter {
        width: 200px;
        text-align: center;
    }
    
    .portfolio-card-content {
        padding: 20px;
    }
    
    .portfolio-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Intersection Observer Animation */
.portfolio-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.portfolio-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Modal Integration */
.portfolio-card[data-modal] {
    cursor: pointer;
}

.portfolio-card[data-modal]:hover::after {
    content: 'Click for details';
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}