 /* ========================================
   Portfolio Itsmolab - Styles
   ======================================== */

/* Filters */
.itsmolab-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0;
}

.itsmolab-filter-btn {
    padding: 10px 20px;
    border: 2px solid #000;
    background: transparent;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 30px;
}

.itsmolab-filter-btn:hover,
.itsmolab-filter-btn.active {
    background: #000;
    color: #fff;
}

/* Grid - Masonry con CSS Columns */
.itsmolab-grid {
    column-count: var(--columns, 3);
    column-gap: 8px;
    padding: 20px 0;
}

@media (max-width: 992px) {
    .itsmolab-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .itsmolab-grid {
        column-count: 1;
    }
    
    .itsmolab-filters {
        justify-content: center;
    }
}

/* Grid Items */
.itsmolab-item {
    break-inside: avoid;
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
    background: #000;
    display: inline-block;
    width: 100%;
}

.itsmolab-item.hidden {
    display: none;
}

.itsmolab-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.itsmolab-item-inner {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

/* Images - natural size */
.itsmolab-item-inner img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Videos - fill container, no black bars */
.itsmolab-item-inner video.itsmolab-video {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

/* Video orientation sizing */
.itsmolab-item.orientation-horizontal .itsmolab-item-inner video.itsmolab-video {
    aspect-ratio: 16/9;
    object-fit: cover;
}

.itsmolab-item.orientation-vertical .itsmolab-item-inner video.itsmolab-video {
    aspect-ratio: 9/16;
    object-fit: cover;
}

.itsmolab-item.orientation-square .itsmolab-item-inner video.itsmolab-video {
    aspect-ratio: 1/1;
    object-fit: cover;
}

.itsmolab-item:hover .itsmolab-item-inner video.itsmolab-video {
    transform: scale(1.03);
}

/* Bunny iframe in grid */
.itsmolab-bunny-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.itsmolab-item.orientation-horizontal .itsmolab-bunny-wrapper {
    aspect-ratio: 16/9;
}

.itsmolab-item.orientation-vertical .itsmolab-bunny-wrapper {
    aspect-ratio: 9/16;
}

.itsmolab-item.orientation-square .itsmolab-bunny-wrapper {
    aspect-ratio: 1/1;
}

.itsmolab-bunny-wrapper .itsmolab-bunny-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border: none;
    pointer-events: none;
    transition: transform 0.5s ease;
}

/* Scale iframe to fill without black bars */
.itsmolab-item.orientation-vertical .itsmolab-bunny-wrapper .itsmolab-bunny-iframe {
    width: 180%;
    height: 100%;
}

.itsmolab-item:hover .itsmolab-bunny-wrapper .itsmolab-bunny-iframe {
    transform: translate(-50%, -50%) scale(1.05);
}

.itsmolab-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #333 0%, #666 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* Overlay - Black text */
.itsmolab-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 60%, transparent 100%);
    padding: 60px 20px 20px;
    color: #000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.itsmolab-item:hover .itsmolab-overlay {
    transform: translateY(0);
}

.itsmolab-overlay h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #000;
}

.itsmolab-overlay .itsmolab-tags {
    font-size: 12px;
    color: #333;
    display: block;
}

/* ========================================
   Modal/Popup - Fixed Size
   ======================================== */
.itsmolab-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

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

.itsmolab-modal-content {
    background: #fff;
    width: 100%;
    max-width: 1200px;
    height: 700px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    animation: itsmolab-modalFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes itsmolab-modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close Button - No background, black X */
.itsmolab-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    color: #000;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    line-height: 1;
    opacity: 0.7;
}

.itsmolab-modal-close:hover {
    transform: scale(1.2);
    opacity: 1;
    background: none;
}

.itsmolab-modal-body {
    display: flex;
    height: 100%;
}

@media (max-width: 900px) {
    .itsmolab-modal-body {
        flex-direction: column;
    }
    
    .itsmolab-modal-content {
        height: auto;
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* Gallery Section (Left) - Fixed */
.itsmolab-modal-gallery {
    flex: 0 0 55%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.itsmolab-gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    overflow: hidden;
}

.itsmolab-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.itsmolab-gallery-main video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.itsmolab-gallery-main iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 6px;
}

.itsmolab-gallery-thumbs {
    flex: 0 0 90px;
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #050505;
    overflow-x: auto;
    flex-wrap: nowrap;
}

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

.itsmolab-gallery-thumbs::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.itsmolab-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.itsmolab-gallery-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.itsmolab-gallery-thumb:hover {
    opacity: 0.85;
}

.itsmolab-gallery-thumb.active {
    opacity: 1;
    border-color: #fff;
}

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

.itsmolab-gallery-thumb.video-thumb {
    position: relative;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itsmolab-gallery-thumb.video-thumb::after {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent rgba(255,255,255,0.9);
    position: absolute;
}

.itsmolab-gallery-thumb.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
}

/* Info Section (Right) */
.itsmolab-modal-info {
    flex: 0 0 45%;
    padding: 35px 30px;
    overflow-y: auto;
    height: 100%;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    .itsmolab-modal-info {
        padding: 25px 20px;
        flex: none;
        height: auto;
    }
    
    .itsmolab-modal-gallery {
        flex: none;
        height: 350px;
    }
}

.itsmolab-modal-info .itsmolab-project-title {
    margin: 0 0 18px 0;
    font-size: 26px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Meta Info Styles */
.itsmolab-project-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.itsmolab-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.itsmolab-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.itsmolab-meta-item.meta-full {
    grid-column: 1 / -1;
}

.itsmolab-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
}

.itsmolab-meta-value {
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.itsmolab-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.itsmolab-meta-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

.itsmolab-meta-tag.tool-tag {
    background: #000;
    color: #fff;
}

/* Description */
.itsmolab-project-description {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

/* Related Projects */
.itsmolab-related {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.itsmolab-related-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
    margin-bottom: 12px;
}

.itsmolab-related-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.itsmolab-related-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #000;
    max-height: 120px;
}

.itsmolab-related-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.itsmolab-related-item .related-inner {
    position: relative;
    line-height: 0;
    height: 120px;
    overflow: hidden;
}

.itsmolab-related-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.itsmolab-related-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.itsmolab-related-item .related-bunny-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.itsmolab-related-item .related-bunny-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 200%;
    transform: translate(-50%, -50%);
    border: none;
    pointer-events: none;
}

.itsmolab-related-item .related-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 12px 10px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 60%, transparent 100%);
    color: #000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.itsmolab-related-item:hover .related-overlay {
    transform: translateY(0);
}

.itsmolab-related-item .related-overlay h4 {
    margin: 0 0 2px 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.itsmolab-related-item .related-overlay span {
    font-size: 10px;
    color: #555;
}

@media (max-width: 900px) {
    .itsmolab-related-grid {
        gap: 6px;
    }
    
    .itsmolab-related-item,
    .itsmolab-related-item .related-inner {
        max-height: 100px;
        height: 100px;
    }
}

/* Loading state */
.itsmolab-item-inner img.loading {
    opacity: 0;
}

.itsmolab-item-inner img.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Infinite Scroll Loader */
.itsmolab-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    width: 100%;
}

.itsmolab-loader.hidden {
    display: none;
}

.itsmolab-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #000;
    border-radius: 50%;
    animation: itsmolab-spin 0.8s linear infinite;
}

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

.itsmolab-end-message {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 14px;
}