/* Portfolio Styles - Pinterest Masonry Layout */

/* Hero Section */
.portfolio-hero {
    background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 100%);
    padding: 30px 0 20px;
    margin-top: 70px;
    text-align: center;
    color: white;
}

.portfolio-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.portfolio-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filters */
.portfolio-filters {
    background: #f8f8f8;
    padding: 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 25px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f0f0f0;
    border-color: #2d5a2d;
}

.filter-btn.active {
    background: #2d5a2d;
    color: white;
    border-color: #2d5a2d;
}

/* Portfolio Section */
.portfolio-section {
    padding: 40px 0;
    background: #f5f5f5;
}

/* Masonry Grid via CSS Columns */
.portfolio-grid {
    column-count: 4;
    column-gap: 18px;
    margin-bottom: 40px;
    transition: opacity 0.3s ease;
}

.portfolio-grid.filtering {
    opacity: 0;
}

/* Project Card */
.project-card {
    break-inside: avoid;
    margin-bottom: 18px;
    display: inline-block;
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

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

/* Image container - natural aspect ratio */
.project-image {
    position: relative;
    overflow: hidden;
    background: #e8e8e8;
    line-height: 0;
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, opacity 0.4s ease;
    opacity: 0;
}

.project-image img.loaded {
    opacity: 1;
}

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

/* Skeleton shimmer while loading */
.skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Category Badge */
.project-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(45, 90, 45, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Project Info */
.project-info {
    padding: 18px;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #888;
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-meta-item::before {
    content: '';
    width: 3px;
    height: 3px;
    background: #bbb;
    border-radius: 50%;
}

.project-meta-item:first-child::before {
    display: none;
}

.project-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: #2d5a2d;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #1a3a1a;
}

.project-link::after {
    content: '\2192';
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.project-link:hover::after {
    transform: translateX(5px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
    column-span: all;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin-top: 40px;
}

#load-more {
    padding: 12px 40px;
    font-size: 1rem;
}

/* No Projects Message */
.no-projects {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    column-span: all;
}

.no-projects h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 2;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 48px;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    padding: 20px;
    z-index: 2;
    line-height: 1;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-counter {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    opacity: 0.7;
    font-weight: 500;
}

.lightbox-title {
    position: absolute;
    top: 25px;
    left: 25px;
    color: white;
    font-size: 16px;
    opacity: 0.8;
    font-weight: 500;
}

/* ===== PROJECT MODAL ===== */
.project-modal,
.order-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.project-modal.active,
.order-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 12px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.order-modal-content {
    grid-template-columns: 1fr;
    max-width: 500px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #999;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

.modal-close:hover {
    color: #333;
}

/* Gallery Styles */
.modal-gallery {
    position: relative;
}

.gallery-container {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-btn.prev { left: 15px; }
.gallery-btn.next { right: 15px; }

.gallery-counter {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail.active {
    border-color: #2d5a2d;
}

/* Modal Info Section */
.modal-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-info h2 {
    font-size: 1.8rem;
    margin: 0;
    margin-bottom: 10px;
}

.modal-info .project-badge {
    display: inline-block;
    padding: 6px 15px;
    background: #2d5a2d;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    width: fit-content;
    position: static;
}

.modal-info .project-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.modal-info .project-meta p {
    margin: 0;
    font-size: 0.95rem;
}

.modal-info .project-meta strong {
    display: block;
    color: #666;
    margin-bottom: 5px;
}

.modal-info .project-description {
    margin: 10px 0;
}

.modal-info .project-description p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.project-features {
    margin-top: 15px;
}

.project-features h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.project-features ul {
    margin: 0;
    padding-left: 20px;
}

.project-features li {
    margin-bottom: 8px;
    color: #555;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
}

/* Order Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 8px;
    color: #444;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d5a2d;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
    .portfolio-grid {
        column-count: 3;
    }
}

@media (max-width: 1024px) {
    .portfolio-grid {
        column-count: 2;
        column-gap: 15px;
    }

    .project-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .portfolio-hero {
        padding: 25px 0 20px;
    }

    .portfolio-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .portfolio-subtitle {
        font-size: 0.95rem;
    }

    .portfolio-grid {
        column-count: 2;
        column-gap: 12px;
    }

    .project-card {
        margin-bottom: 12px;
    }

    .filter-buttons {
        padding: 0 15px;
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }

    .project-info {
        padding: 14px;
    }

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

    .project-description {
        display: none;
    }

    .modal-content {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px auto;
        width: 95%;
        padding: 25px;
    }

    .order-modal-content {
        max-width: 90%;
    }

    .gallery-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .modal-info .project-meta {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* Lightbox mobile */
    .lightbox-nav {
        font-size: 36px;
        padding: 10px;
    }

    .lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        column-count: 1;
        column-gap: 0;
    }

    .project-card {
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .project-info {
        padding: 12px;
    }

    .project-description {
        display: block;
        font-size: 0.85rem;
    }
}
