/* ========================================
   Projects Page Spacing Enhancements
   Professional Layout with Proper Breathing Room
   ======================================== */

/* Override and enhance existing project styles */

/* Filter Section Improvements */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px !important; /* Increased gap between buttons */
    justify-content: center;
    margin-bottom: 40px !important; /* Proper separation from grid */
    padding: 0 20px; /* Add horizontal padding */
}

.filter-btn {
    padding: 12px 24px; /* More generous button padding */
    background: white;
    color: #5a6c7d;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
    min-width: 120px; /* Ensure consistent button sizes */
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking on mobile */
}

.filter-btn:hover,
.filter-btn.active {
    background: #ff8c00;
    color: white;
    border-color: #ff8c00;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.3);
}

/* Projects Grid Enhanced Spacing */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 40px !important; /* Generous horizontal spacing */
    row-gap: 40px !important; /* Generous vertical spacing */
    margin-top: 0 !important; /* Remove since filter has margin-bottom */
    padding: 0 20px; /* Add container padding */
}

/* Project Card Enhancements */
.project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 0; /* Remove any existing margin */
}

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

/* Project Info Spacing */
.project-info {
    padding: 24px; /* Generous internal padding */
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.3;
}

.project-location {
    color: #8a9ba8;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-description {
    color: #5a6c7d;
    line-height: 1.6;
    margin: 0;
    font-size: 15px;
}

/* Large Project Card Spacing */
.project-card-large {
    grid-column: auto; /* align with standard cards */
    min-height: auto;  /* remove forced height */
}

.project-card-large .project-info {
    padding: 24px; /* match standard card padding */
}

/* Project Stats Spacing */
.project-stats {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.stat {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 140, 0, 0.1);
    color: #ff8c00;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

/* Responsive Breakpoints with Proper Spacing */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns on large screens */
        gap: 50px !important; /* Extra generous spacing on large screens */
        row-gap: 50px !important;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .filter-buttons {
        gap: 25px !important; /* Extra space between buttons */
        margin-bottom: 50px !important;
    }
}

/* Medium Desktop (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
        gap: 35px !important;
        row-gap: 40px !important;
    }
    
    .filter-buttons {
        gap: 18px !important;
        margin-bottom: 35px !important;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        gap: 30px !important;
        row-gap: 35px !important;
        padding: 0 15px;
    }
    
    .filter-buttons {
        gap: 16px !important;
        margin-bottom: 30px !important;
        padding: 0 15px;
    }
    
    .project-card-large {
        grid-column: auto; /* match standard behavior */
    }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        row-gap: 30px !important;
        padding: 0 15px;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        gap: 15px !important;
        margin-bottom: 25px !important;
        padding: 0 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .filter-buttons::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .filter-btn {
        min-width: 110px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-card-large .project-info {
        padding: 24px;
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        row-gap: 25px !important;
        padding: 0 10px;
    }
    
    .filter-buttons {
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding: 0 10px;
    }
    
    .filter-btn {
        min-width: 100px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .project-info {
        padding: 16px;
    }
    
    .project-info h3 {
        font-size: 18px;
    }
    
    .project-description {
        font-size: 14px;
    }
    
    .project-card-large {
        min-height: auto;
    }
    
    .project-card-large .project-info {
        padding: 20px;
    }
}

/* Section Padding Improvements */
.projects-section {
    padding: 60px 0 80px 0 !important; /* More generous section padding */
    background: #f8f9fa;
}

.page-hero {
    padding-bottom: 40px !important; /* Better separation from projects */
}

/* Ensure proper container spacing */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
}

/* Animation Improvements */
.project-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Staggered animation delays */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }
.project-card:nth-child(8) { animation-delay: 0.8s; }
.project-card:nth-child(9) { animation-delay: 0.9s; }

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

/* Print Styles */
@media print {
    .filter-buttons {
        display: none;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        row-gap: 20px !important;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

