/* ===== PORTFOLIO PAGE STYLES ===== */

/* Global Styles */
html, body {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

/* Ensure all elements stay within viewport */
.container {
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Extra protection for images */
img {
    max-width: 100%;
    height: auto;
}

/* ===== PORTFOLIO HERO SECTION ===== */
.portfolio-hero {
    padding-top: 76px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9) 0%, rgba(52, 152, 219, 0.9) 100%), 
                url('../images/custom web.jpg') center/cover no-repeat;
    color: white;
    text-align: center;
}

.portfolio-hero h1,
.portfolio-hero .lead {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Portfolio Stats */
.stat-item {
    padding: 1rem;
    min-width: 120px;
}

.stat-item .h3 {
    font-size: 2.5rem;
}

/* ===== PORTFOLIO CARDS ===== */
.portfolio-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15) !important;
}

.portfolio-image {
    position: relative;
    overflow: hidden;
}

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

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

.portfolio-overlay {
    background: rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Portfolio Filter Buttons */
#portfolio-filters .btn {
    transition: all 0.3s ease;
    border-radius: 25px;
}

#portfolio-filters .btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

#portfolio-filters .btn:hover:not(.active) {
    background-color: #e9ecef;
    border-color: #0d6efd;
}

/* Portfolio Items Animation */
.portfolio-item {
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 1.5rem;
}

/* Hide portfolio items initially for filter animation */
.portfolio-item {
    display: block;
}

/* ===== CASE STUDIES SECTION ===== */
.bg-dark .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .portfolio-hero {
        min-height: 70vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .stat-item {
        min-width: 100px;
    }
    
    .stat-item .h3 {
        font-size: 2rem;
    }
    
    /* Adjust padding for mobile */
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Filter buttons stack on mobile */
    #portfolio-filters {
        gap: 0.5rem;
    }
    
    #portfolio-filters .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation delays for portfolio items */
.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

/* Filter animation */
.portfolio-item.hidden {
    display: none !important;
}

.portfolio-item.visible {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

/* ===== SCROLL TO TOP BUTTON ===== */
#scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

#scrollToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===== CUSTOM UTILITIES ===== */
.min-vh-80 {
    min-height: 80vh;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Badge styles */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Button hover effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Card hover shadow */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.portfolio-card:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}