/* Project Gallery Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

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

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

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

.modal-body {
    height: 100%;
    overflow-y: auto;
}

/* Project Modal Content */
.project-modal-content {
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.project-modal-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.project-modal-category {
    font-size: 1.1rem;
    color: #007bff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gallery Styles */
.project-modal-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-main {
    position: relative;
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gallery-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.gallery-prev,
.gallery-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.gallery-prev:disabled,
.gallery-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-prev:disabled:hover,
.gallery-next:disabled:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.7);
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    max-height: 120px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 3px solid transparent;
}

.gallery-thumb:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: #007bff;
}

/* Loading state */
.gallery-main.loading {
    background: #f8f9fa url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" fill="none" stroke="%23007bff" stroke-width="2" stroke-dasharray="56.5" stroke-dashoffset="56.5"><animate attributeName="stroke-dashoffset" dur="2s" values="56.5;0;56.5" repeatCount="indefinite"/></circle></svg>') center center no-repeat;
}

/* Project item updates for better integration */
.project-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.project-category {
    color: #007bff;
    font-size: 0.9rem;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-buttons {
    display: flex;
    gap: 10px;
}

.btn-view {
    width: 40px;
    height: 40px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .project-modal-content {
        padding: 20px;
    }
    
    .project-modal-title {
        font-size: 2rem;
    }
    
    .gallery-controls {
        padding: 0 10px;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .project-modal-title {
        font-size: 1.5rem;
    }
    
    .project-modal-category {
        font-size: 1rem;
    }
    
    .gallery-thumbnails {
        max-height: 80px;
    }
    
    .gallery-thumb {
        width: 50px;
        height: 50px;
    }
    
    .gallery-main {
        min-height: 300px;
    }
    
    .project-image {
        height: 180px;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .project-overlay {
        padding: 15px;
    }
}

/* Animation for project loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-item.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading spinner for projects */
.projects-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 1.1rem;
    color: #666;
}

.projects-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}