/* Projects Showcase Frontend Styles */

.projects-showcase {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.projects-header {
    text-align: center;
    margin-bottom: 40px;
}

.projects-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.projects-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #ff6b35;
    margin: 15px auto;
}

.projects-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.projects-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-2px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

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

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-placeholder {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.project-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
}

.project-category-badge {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status-badge.status-hoan-thanh {
    background: #28a745;
    color: white;
}

.project-status-badge.status-dang-thuc-hien {
    background: #ffc107;
    color: #212529;
}

.project-status-badge.status-tam-dung {
    background: #dc3545;
    color: white;
}

.project-status-badge.status-ke-hoach {
    background: #17a2b8;
    color: white;
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.project-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.project-location,
.project-year {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.project-location i,
.project-year i {
    color: #dc3545;
    width: 16px;
}

.project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.project-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.project-value,
.project-timeline {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-details .label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.project-details .value {
    font-weight: bold;
    color: #333;
}

.project-details-btn {
    width: 100%;
    background: linear-gradient(45deg, #dc3545, #ff6b35);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

.project-details-btn:hover {
    background: linear-gradient(45deg, #c82333, #e55a2b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.projects-load-more {
    text-align: center;
    margin-top: 40px;
}

#load-more-projects {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

#load-more-projects:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

#load-more-projects:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    padding: 40px;
}

/* Modal Styles */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh !important;
    overflow: hidden !important;
    z-index: 10000;
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10001;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #c82333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(90vh - 80px) !important;
    flex: 1;
    position: relative;
}

.project-modal-header {
    margin-bottom: 30px;
}

.project-modal-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.project-modal-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    min-height: 0 !important;
    height: 100%;
    overflow: hidden;
}

.project-modal-left {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(90vh - 200px) !important;
    padding-right: 10px;
}

.project-featured-image {
    margin-bottom: 30px;
    flex-shrink: 0;
}

.project-featured-image img {
    width: 100%;
    border-radius: 10px;
}

.project-gallery {
    flex-shrink: 0;
}

.project-gallery h4 {
    margin-bottom: 15px;
    color: #333;
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 0;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.project-modal-right {
    padding-left: 20px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(90vh - 200px) !important;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-modal .project-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.project-modal .project-meta {
    flex-shrink: 0;
}

.project-modal .project-details {
    flex-shrink: 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.project-info h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    margin-top: 0;
    font-size: 1.2rem;
}

.project-meta {
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.meta-item i {
    color: #dc3545;
    width: 20px;
}

.project-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.project-details .detail-item:last-child {
    border-bottom: none;
}

.project-modal .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.project-modal .detail-item:last-child {
    border-bottom: none;
}

.project-modal .detail-item .label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.project-modal .detail-item .value {
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.project-modal .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.project-modal .meta-item i {
    color: #dc3545;
    width: 16px;
    font-size: 0.9rem;
}

/* Specific styles for modal description */
.project-modal .project-description {
    max-height: 150px !important;
    overflow-y: auto !important;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.project-modal .project-description h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 5px 0;
    z-index: 1;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1rem;
}

.project-modal .project-description p {
    margin-bottom: 10px;
    text-align: justify;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-modal .project-description p:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar for description */
.project-modal .project-description::-webkit-scrollbar {
    width: 6px !important;
}

.project-modal .project-description::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 6px !important;
}

.project-modal .project-description::-webkit-scrollbar-thumb {
    background: #dc3545 !important;
    border-radius: 6px !important;
}

.project-modal .project-description::-webkit-scrollbar-thumb:hover {
    background: #c82333 !important;
}

/* Custom scrollbar for modal */
.projects-showcase .modal-body::-webkit-scrollbar,
.projects-showcase .project-modal-right::-webkit-scrollbar,
.projects-showcase .project-modal-left::-webkit-scrollbar {
    width: 8px !important;
}

.projects-showcase .modal-body::-webkit-scrollbar-track,
.projects-showcase .project-modal-right::-webkit-scrollbar-track,
.projects-showcase .project-modal-left::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 10px !important;
}

.projects-showcase .modal-body::-webkit-scrollbar-thumb,
.projects-showcase .project-modal-right::-webkit-scrollbar-thumb,
.projects-showcase .project-modal-left::-webkit-scrollbar-thumb {
    background: #dc3545 !important;
    border-radius: 10px !important;
}

.projects-showcase .modal-body::-webkit-scrollbar-thumb:hover,
.projects-showcase .project-modal-right::-webkit-scrollbar-thumb:hover,
.projects-showcase .project-modal-left::-webkit-scrollbar-thumb:hover {
    background: #c82333 !important;
}

/* Force scroll styles for compatibility */
.projects-showcase .project-modal {
    overflow: hidden !important;
}

.projects-showcase .project-modal .modal-content {
    overflow: hidden !important;
    height: 90vh !important;
    max-height: 90vh !important;
}

.projects-showcase .project-modal .modal-body {
    overflow: auto !important;
    height: calc(90vh - 60px) !important;
    max-height: calc(90vh - 60px) !important;
}

/* For Firefox scrollbar */
.projects-showcase .modal-body,
.projects-showcase .project-modal-right,
.projects-showcase .project-modal-left {
    scrollbar-width: thin !important;
    scrollbar-color: #dc3545 #f1f1f1 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .projects-title {
        font-size: 2rem;
    }
    
    .project-card {
        margin: 0 10px;
    }
    
    .project-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .project-modal-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-modal-right {
        padding-left: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    .project-modal-left {
        max-height: none;
        overflow-y: visible;
    }
    
    .modal-content {
        max-width: 95vw;
        margin: 20px;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(95vh - 60px);
    }
    
    .projects-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .projects-showcase {
        padding: 20px 15px;
    }
    
    .projects-title {
        font-size: 1.8rem;
    }
    
    .projects-subtitle {
        font-size: 1rem;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .project-badges {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 10px;
        border-radius: 10px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(98vh - 50px);
    }
    
    .project-modal-header h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
}

/* Loading states */
.projects-loading {
    text-align: center;
    padding: 40px;
}

.projects-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc3545;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Flatsome theme compatibility */
.flatsome-builder .projects-showcase {
    padding: 0;
}

.flatsome-builder .projects-header {
    margin-bottom: 30px;
}

/* Print styles */
@media print {
    .projects-filters,
    .projects-load-more,
    .project-details-btn {
        display: none;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}