/* Portfolio Gallery Styles - MultiGallery-inspired */

.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

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

.portfolio-header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.portfolio-subtitle {
    color: var(--secondary-color);
    font-size: 1.1em;
    margin: 0;
}

/* Filters */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-tag {
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
}

.filter-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.filter-tag.active {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Gallery Grid */
.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.gallery-item {
    position: relative;
    height: 360px;
    background: #000;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
    transition: all 0.3s;
}

.gallery-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.gallery-item-content {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgb(26, 26, 26);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.gallery-item-content img {
    position: relative;
    display: block;
    opacity: 0.45;
    width: 105%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s, transform 0.35s;
    transform: translate3d(-23px, 0, 0);
    backface-visibility: hidden;
}

.gallery-item:hover .gallery-item-content img {
    opacity: 0.3;
    transform: translate3d(0, 0, 0);
}

.gallery-item-caption {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2em 2em 3em 2em;
    color: #fff;
    text-align: left;
    max-width: 70%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.gallery-item h2 {
    font-weight: 300;
    font-size: 1.5em;
    overflow: hidden;
    padding: 0.5em 0;
    margin: 0;
    position: relative;
    z-index: 10;
    color: var(--accent-color);
}

.gallery-item h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 15%;
    height: 1px;
    background: #fff;
    transition: transform 0.3s;
    transform: translate3d(-100%, 0, 0);
}

.gallery-item:hover h2::after {
    transform: translate3d(0, 0, 0);
}

.gallery-item p {
    letter-spacing: 1px;
    font-size: 0.85em;
    padding: 1em 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.35s, transform 0.35s;
    transform: translate3d(10%, 0, 0);
    position: relative;
    z-index: 10;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 11;
    line-clamp: 11;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    max-height: 16.8em;
}

.gallery-item:hover p {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    max-width: 900px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 4px;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2em;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1001;
}

.modal-nav-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    font-size: 2em;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: all;
    font-family: var(--font-family);
}

.modal-nav-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.modal-body {
    padding: 60px 80px 40px 80px;
}

.modal-body h2 {
    color: var(--primary-color);
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

#modalContentArea {
    margin: 30px 0;
    text-align: center;
}

.modal-image {
    max-width: clamp(200px, 90%, 500px);
    max-height: clamp(200px, 70vh, 500px);
    width: auto;
    height: auto;
    border: 1px solid var(--secondary-color);
    display: block;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--secondary-color);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#modalDescription {
    margin: 30px 0;
    line-height: 1.6;
    color: var(--text-color);
}

#modalDescription p {
    margin: 0;
}

#modalExtras {
    margin-top: 30px;
    text-align: center;
}

.extras-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    transition: all 0.3s;
    border-radius: 2px;
}

.extras-link:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.external-link {
    display: inline-block;
    padding: 15px 30px;
    background: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    border-radius: 2px;
}

.external-link:hover {
    background: var(--text-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.back-to-home {
    text-align: center;
    margin-top: 60px;
}

.back-to-home a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.back-to-home a:hover {
    color: var(--primary-color);
}

.back-to-home .separator {
    color: var(--secondary-color);
    margin: 0 10px;
    opacity: 0.5;
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-color);
}

/* Admin Floating Edit Button */
.admin-floating-btn {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    animation: slideIn 0.3s ease-out;
}

.admin-floating-btn a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: rgba(0, 255, 255, 0.9);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
    transition: all 0.3s;
    border: 2px solid var(--primary-color);
}

.admin-floating-btn a:hover {
    background: var(--primary-color);
    box-shadow: 0 6px 25px rgba(0, 255, 255, 0.6);
    transform: translateX(-5px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        min-width: unset;
    }
    
    .modal-body {
        padding: 40px 60px 20px 60px;
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }
    
    .admin-floating-btn {
        right: 15px;
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .admin-floating-btn a {
        padding: 12px 20px;
        font-size: 0.85em;
    }
}
