/* Portfolio Page Styles */

.portfolio-hero {
    padding: 4rem 2rem 2rem 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 3rem;
}

.portfolio-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.portfolio-header .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Homepage portfolio adjustments */
.portfolio-section .portfolio-grid {
    max-width: 100%;
}

.portfolio-section .filter-container {
    padding: 0;
}

/* Filter Buttons */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

/* Portfolio Grid */
.portfolio-grid-section {
    padding: 0 2rem 4rem 2rem;
}

.portfolio-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2rem;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Project Card */
.project-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    box-sizing: border-box;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-card.featured {
    grid-column: 1 / -1;
}

/* Project Thumbnail */
.project-thumbnail {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.project-card.featured .project-thumbnail {
    height: 320px;
}

.project-thumbnail img,
.project-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.project-card:hover .project-thumbnail img,
.project-card:hover .project-thumbnail video {
    transform: scale(1.1);
}

/* Ensure video thumbnails play smoothly */
.project-thumbnail video {
    pointer-events: none;
}

/* Overlay on hover */
.project-thumbnail::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-thumbnail::after {
    opacity: 1;
}

/* Play button for video projects */
.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.project-card:hover .play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-indicator::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 20px solid #1a1a2e;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

/* Project Info */
.project-info {
    padding: 1.75rem;
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-header {
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.project-meta-info {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.project-category-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.project-year-badge {
    opacity: 0.7;
}

.project-excerpt {
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    font-size: 0.95rem;
}

.project-tech-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tech-tag-preview {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 0.25rem;
    color: var(--primary);
}

/* Project Modal */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.project-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.project-modal-content {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Media */
.project-modal-media {
    flex: 1.2;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.project-modal-media img,
.project-modal-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Info */
.project-modal-info {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.project-modal-header {
    margin-bottom: 2rem;
}

.project-modal-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.project-category,
.project-year {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.project-details {
    margin-bottom: 2rem;
}

.project-details h3,
.project-tech h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-details ul {
    list-style: none;
}

.project-details li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    position: relative;
}

.project-details li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tech-tag {
    padding: 0.5rem 1rem;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--primary);
    font-size: 0.9rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.project-link {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(100, 200, 255, 0.3);
}

.project-link.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.project-link.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1.5rem;
    }

    .project-card.featured {
        grid-column: 1 / -1;
    }

    .project-card.featured .project-thumbnail {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .portfolio-header h1 {
        font-size: 2.5rem;
    }

    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.5rem;
        padding: 0;
    }

    .project-card.featured {
        grid-column: span 1;
    }

    .project-thumbnail {
        height: 280px;
    }

    .project-card.featured .project-thumbnail {
        height: 280px;
    }

    .project-info {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.2rem;
    }

    .filter-container {
        padding: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .project-modal-content {
        flex-direction: column;
        width: 95%;
        max-height: 95vh;
    }

    .project-modal-media {
        min-height: 250px;
    }

    .project-modal-info {
        padding: 2rem 1.5rem;
    }

    .project-modal-header h2 {
        font-size: 1.8rem;
    }
}

/* Loading State */
.portfolio-grid.loading::after {
    content: "Loading projects...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Filter Animation */
.project-card.hiding {
    display: none !important;
}

.project-card.showing {
    display: flex !important;
}
