/* ===== PORTFOLIO STYLES ===== */

#portfolio.section {
    padding-top: 30px;
}

/* ===== COMMON GRID STYLES ===== */
.portfolio-grid {
    width: 100%;
    margin: 0 auto;
}

.video-grid,
.gif-grid {
    display: grid !important;
    width: 100% !important;
    margin: 0 auto !important;
    gap: 15px;
}

.video-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    row-gap: 30px;
}

.gif-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    width: 80% !important;
    align-items: end;
    background: #fff;
    border-radius: 15px;
    padding: 50px 60px 50px 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #f4f4f4;
}

/* ===== COMMON ITEM STYLES ===== */
.video-item,
.gif-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.gif-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ===== IMAGE STYLES ===== */
.video-poster,
.video-preview,
.gif-preview,
.gif-animation {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.video-poster,
.video-preview,
.gif-preview,
.gif-animation {
    position: absolute;
    top: 0;
    left: 0;
}

.video-preview {
    opacity: 0;
}

/* ===== VIDEO SPECIFIC STYLES ===== */
.video-item {
    cursor: pointer;
    aspect-ratio: 16/9;
    background: #000;
    margin-bottom: 0;
}

/* ===== GIF SPECIFIC STYLES ===== */
.gif-item {
    background: #000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.gif-item.square {
    aspect-ratio: 4/3;
    grid-column: span 1;
}

.gif-item.wide {
    aspect-ratio: 2.5/1;
    grid-column: span 1;
}

.gif-item.ultra-wide {
    aspect-ratio: 4.5/1;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 55%;
    justify-self: center;
    margin-top: 25px;
}

.gif-preview {
    display: block;
    opacity: 1;
}

.gif-animation {
    display: none;
    opacity: 1;
}

.gif-item.playing .gif-preview {
    display: none;
}

.gif-item.playing .gif-animation {
    display: block;
}

/* ===== CONTROL BUTTONS ===== */
.play-overlay,
.play-btn,
.pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(101, 101, 101);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

.play-overlay {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.play-overlay:hover,
.play-btn:hover,
.pause-btn:hover {
    opacity: 1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%) scale(1.05);
}

.video-item:hover .play-overlay {
    opacity: 0;
}

.gif-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    padding: 8px 15px;
    border-radius: 25px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.gif-item:hover .gif-controls {
    opacity: 1;
}

.gif-item.playing .gif-controls {
    opacity: 0;
}

.gif-item.playing:hover .gif-controls {
    opacity: 0.8;
}

/* ===== TABS NAVIGATION ===== */
.portfolio-tabs-nav {
    display: flex;
    position: relative;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    justify-content: center;
    margin: 24px 0 30px 0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.portfolio-tab-btn {
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95em;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: column;
}

.portfolio-tab-btn i {
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.portfolio-tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.portfolio-tab-btn.active {
    background: white;
    color: #3498db;
    border-bottom-color: #3498db;
}

.portfolio-tab-btn.active i {
    color: #3498db;
}

/* ===== VIDEO MODAL STYLES ===== */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.video-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.video-modal-player {
    width: 100%;
    height: auto;
    max-width: 1024px;
    max-height: 576px;
    display: block;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== COLLAGE WITH MAGNIFIER STYLES ===== */
.collage-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.static-cursor-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    cursor: url('../assets/images/zoom_pointer.png') 14 18, auto;
}

.collage-wrapper {
    position: relative;
    max-width: 1200px;
    width: 100%;
    cursor: crosshair;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.collage-image {
    width: 100%;
    height: auto;
    display: block;
}

.magnifier-glass {
    position: fixed;
    border: 3px solid #3498db;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    pointer-events: none;
    z-index: 10000;
    display: none;
    width: 600px;
    height: 600px;
    border-radius: 8px;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .portfolio-grid {
        width: 90%;
    }

    .gif-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gif-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 15px !important;
    }

    .portfolio-tabs-nav {
        flex-direction: column;
    }

    .portfolio-tab-btn {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        border-bottom: 1px solid #e9ecef;
        border-left: 3px solid transparent;
    }

    .portfolio-tab-btn.active {
        border-left-color: #3498db;
        border-bottom-color: #e9ecef;
    }

    .portfolio-grid {
        width: 100%;
    }

    .collage-wrapper {
        cursor: crosshair;
    }

    .magnifier-glass {
        width: 300px !important;
        height: 300px !important;
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .video-grid,
    .gif-grid {
        grid-template-columns: 1fr !important;
    }

    .portfolio-tab-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .play-overlay,
    .play-btn,
    .pause-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .gif-item {
        aspect-ratio: 16/9;
    }

    .collage-container {
        padding: 10px 0;
    }

    .collage-wrapper {
        border-radius: 8px;
    }

    .magnifier-glass {
        width: 250px !important;
        height: 250px !important;
    }
}

/* ===== FLASH GRID STYLES ===== */
.flash-grid {
    display: flex;
    flex-direction: column;
    width: 82%;
    margin: 0 auto;
    overflow: hidden;
}

.flash-featured-project {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    margin: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #f4f4f4;
}

.flash-project-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 60px;
    align-items: start;
    justify-content: center;
    justify-items: center;
    margin: 0 auto;
    max-width: 1000px;
}

.flash-image-container {
    width: 500px;
    height: 200px;
    transition: all 0.4s ease;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    position: relative;
}

.flash-image-container:hover {
    height: 425px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.flash-featured-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.flash-text-container {
    padding: 0;
    align-self: top;
}

.flash-project-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 7px;
    font-weight: 600;
}

.flash-project-description {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 8px;
    line-height: 1.5;
}

.flash-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.flash-features-list li {
    padding: 8px 0;
    color: #555;
    line-height: 1.5;
    position: relative;
    padding-left: 25px;
}

.flash-features-list li::before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: 10px;
    font-weight: bold;
}

.flash-banners-section {
    margin: 20px;
}

.flash-banners-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.flash-banners-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.flash-banners-section {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

.flash-banner-content {
    position: relative;
    display: inline-block;
}

.flash-banner-preview {
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    opacity: 1;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.flash-banner-video {
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    opacity: 0;
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(101, 101, 101);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
    z-index: 10;
}

.flash-banner-item:hover .play-overlay {
    opacity: 0;
}

.flash-banner-item:hover .flash-banner-preview {
    opacity: 0;
    transition: all 0.3s ease;
}

.flash-banners-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 0px;
    text-align: center;
    font-weight: 600;
}

.flash-banner-note {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 30px;
    font-style: italic;
}

@media (max-width: 1200px) {
    .flash-project-content {
        grid-template-columns: 500px 1fr;
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .flash-project-content {
        grid-template-columns: 400px 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .flash-grid {
        width: 100% !important;
    }

    .flash-project-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* ===== FLEXOGRAPHY STYLES ===== */
.flexography-wrapper {
    width: 90%;
    margin: 0 auto;
}

.flexography-canvas {
    background: #fff;
    border-radius: 15px;
    padding: 25px 20px 40px 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #f4f4f4;
    min-height: 400px;
    width: 100%;
}

.flexography-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f4f4f4;
}

.flexography-header h3 {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
}

.flexography-works {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.flexography-work-left {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.flexography-work-right {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.work-text {
    text-align: left;
}

.work-text p {
    color: #555;
    font-size: 1.1em;
}

.work-text p:first-child {
    font-size: 1.1em;
    color: #2c3e50;
}

.work-text strong {
    color: #2c3e50;
    font-weight: 700;
}

.flexography-work-left .work-text {
    min-height: 115px;
}

.flexography-work-right .work-text {
    min-height: 115px;
}

.work-images-horizontal {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
}

.horizontal-image-item img {
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.work-image-horizontal img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .flexography-wrapper {
        width: 100%;
    }

    .flexography-canvas {
        padding: 25px;
        border-radius: 10px;
    }

    .flexography-works {
        flex-direction: column;
        gap: 40px;
    }

    .work-image-horizontal img {
        width: 100%;
        max-width: 300px;
    }

    .work-text p {
        color: #555;
        line-height: 1.6;
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .work-text p:first-child {
        font-size: 1.2em;
        color: #2c3e50;
        margin-bottom: 15px;
    }

    .flexography-work-left .work-text,
    .flexography-work-right .work-text {
        min-height: auto;
    }
}

/* ===== 3D MODELING STYLES ===== */
.modeling3d-wrapper {
    width: 80%;
    margin: 0 auto;
}

.modeling3d-canvas {
    background: #fff;
    border-radius: 15px;
    padding: 30px 60px 60px 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #f4f4f4;
    min-height: 400px;
    width: 100%;
}

.modeling3d-model-section {
    height: 100%;
    display: flex;
}

.sketchfab-embed-wrapper {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sketchfab-iframe {
    width: 100%;
    height: 92%;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sketchfab-attribution {
    font-size: 13px;
    font-weight: normal;
    margin: 10px 0;
    color: #4A4A4A;
    text-align: center;
    line-height: 1.4;
}

.sketchfab-attribution a {
    font-weight: bold;
    color: #1CAAD9;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sketchfab-attribution a:hover {
    color: #1684a8;
    text-decoration: underline;
}

.modeling3d-content {
    display: grid;
    grid-template-columns: 55% auto;
    gap: 40px;
    align-items: stretch;
}

.modeling3d-left {
    display: flex;
    flex-direction: column;
}

.modeling3d-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.modeling3d-description {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.modeling3d-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.2;
}

.modeling3d-subtitle {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

.modeling3d-image-item {
    text-align: center;
}

.modeling3d-image {
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modeling3d-image.real-photo {
    width: 100%;
    height: auto;
}

.modeling3d-renders-grid {
    display: grid;
    grid-template-columns: 39.1% auto;
    gap: 10px;
    align-items: start;
}

.modeling3d-render-container {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 0;
}

.modeling3d-image.render-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
    border-radius: 8px;
}

.modeling3d-render-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modeling3d-render-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.modeling3d-render-container:hover {
    transform: translateY(-3px);
}

.modeling3d-render-container:hover .modeling3d-image.render-image {
    border-color: #3498db;
}

.modeling3d-render-container:hover::before {
    opacity: 1;
}

.render-hint {
    z-index: 2;
}

.render-hint {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 0 0 0 30px;
    box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    margin: -1px;
}

.render-hint::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 12px;
    width: 20px;
    height: 20px;
    background: url('../assets/images/click_hint.png') no-repeat center;
    background-size: contain;
    opacity: 0.5;
}

.render-hint:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.3);
}

.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.image-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    width: 100%;
    height: auto;
    max-width: 1200px;
    max-height: 80vh;
    display: block;
    object-fit: contain;
}

@media (max-width: 768px) {
    .modeling3d-canvas {
        padding: 25px;
    }

    .modeling3d-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .modeling3d-renders-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modeling3d-description {
        padding: 0 10px;
    }

    .modeling3d-title {
        font-size: 1.5em;
    }

    .modeling3d-subtitle {
        font-size: 1em;
        padding: 0 10px;
    }

    .sketchfab-iframe {
        height: 400px;
    }

    .modeling3d-render-container {
        height: 180px;
    }
}