/* Portfolio Advanced Styles */

/* Portfolio Hero Section */
.portfolio-hero {
    background: var(--gradient-main);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero.gradient-bg-extended {
    animation: none;
    background-size: 100% 100%;
}

.portfolio-hero::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="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.portfolio-hero .container {
    position: relative;
    z-index: 2;
}

.portfolio-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.portfolio-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.portfolio-hero .hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Portfolio Filter Section */
.portfolio-filter {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    padding: 40px 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

/* Portfolio Controls */
.portfolio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid rgba(99, 102, 241, 0.12);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sort-controls select {
    padding: 12px 20px;
    border: 2px solid rgba(99, 102, 241, 0.12);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.sort-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Series Filters */
.series-filters {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.series-filters h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.series-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.series-filter {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.12);
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.series-filter:hover {
    border-color: #6366f1;
    color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.22);
}

.series-filter.active {
    background: var(--gradient-main);
    border-color: #6366f1;
    color: white;
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.32);
}

.series-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Filter Button Counts */
.filter-btn .count {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(99, 102, 241, 0.12);
    color: #495057;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.filter-btn i {
    font-size: 1.1rem;
}

/* Portfolio Grid Section */
.portfolio-grid-section {
    padding: 60px 0;
    background: white;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.portfolio-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.portfolio-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.portfolio-image img,
.portfolio-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-image img,
.portfolio-item:hover .portfolio-image video {
    transform: scale(1.1);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.play-button:hover {
    background: rgba(102, 126, 234, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.portfolio-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: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    text-align: center;
    color: white;
    padding: 20px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-info {
    transform: translateY(0);
}

.portfolio-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.portfolio-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.5;
}

.portfolio-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

.portfolio-date,
.portfolio-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Portfolio Stats Section */
.portfolio-stats {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Portfolio Modal */
.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 1000px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.modal-body {
    padding: 0;
}

.modal-body img,
.modal-body video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* Series Badge */
.series-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Loading Animation */
.portfolio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #667eea;
}

.portfolio-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-hero h1 {
        font-size: 2rem;
    }
    
    .portfolio-hero p {
        font-size: 1rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-content h3 {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .portfolio-hero {
        padding: 60px 0;
    }
    
    .portfolio-hero h1 {
        font-size: 1.8rem;
    }
    
    .portfolio-grid {
        gap: 15px;
    }
    
    .portfolio-image {
        height: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 20px 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .portfolio-filter {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
    
    .filter-btn {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .portfolio-grid-section {
        background: #1a1a1a;
    }
    
    .portfolio-item {
        background: #2d2d2d;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
}

/* Print Styles */
@media print {
    .portfolio-filter,
    .portfolio-stats {
        display: none;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .portfolio-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}