/* References Page Specific Styles */

/* Hero Portfolio Section */
.hero-portfolio {
    padding: 120px 0 80px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../sources/ocelove-konstrukcie/steel-construction-2.jpg');
    background-size: cover;
    background-position: center 20%;
    background-attachment: fixed;
    text-align: center;
}

.hero-portfolio h1 {
    font-size: 7.5rem;
    font-weight: 700;
    color: white;
    -webkit-text-stroke: 2px #000;
    text-stroke: 2px #000;
    margin-bottom: 1rem;
    text-align: left;
    margin-left: 80px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
    position: relative;
    overflow: hidden;
    line-height: 1.0;
}

.hero-portfolio h1::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    color: #2563eb;
    white-space: nowrap;
    overflow: hidden;
    transition: width 2s ease-in-out 0.8s;
    background: transparent;
    -webkit-text-stroke: 0;
    text-stroke: 0;
}

.hero-portfolio h1.animate {
    opacity: 1;
    transform: translateY(0);
}

.hero-portfolio h1.fill-animate::before {
    width: 100%;
}

.hero-portfolio p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Portfolio Section */
.portfolio-section {
    padding: 4rem 0;
    background: #f8f9fa;
    min-height: 500px;
    display: block;
    visibility: visible;
}

/* Filter Buttons */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
    text-align: center;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(51, 51, 51, 0.3);
}

/* Shining border effect for active button */
.filter-btn.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent, 
        transparent, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    background-size: 400% 400%;
    animation: shine 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes shine {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 4rem;
    padding: 0 5px;
    min-height: 200px;
    width: 100%;
}

.portfolio-item {
    background: var(--accent-color);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all var(--transition-smooth);
    cursor: pointer;
    opacity: 1;
    display: block;
    min-height: 300px;
    position: relative;
}

.portfolio-item.hidden {
    display: none;
    opacity: 0;
}

.portfolio-item:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.portfolio-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform var(--transition-smooth);
    border-radius: 0;
    display: block;
    transform: scale(1.01);
}

.portfolio-item:hover img {
    transform: scale(1.11);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxZoom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer !important;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.lightbox-image.slide-left {
    animation: slideOutLeft 0.3s ease forwards;
}

.lightbox-image.slide-right {
    animation: slideOutRight 0.3s ease forwards;
}

.lightbox-image.slide-in-left {
    animation: slideInFromRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lightbox-image.slide-in-right {
    animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(-100px) scale(0.9);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(100px) scale(0.9);
        opacity: 0;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.lightbox-nav {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    z-index: 10002 !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.lightbox-nav:hover {
    background: #2563eb !important;
    transform: translateY(-50%) scale(1.15) !important;
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4) !important;
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.lightbox-prev {
    left: 30px !important;
}

.lightbox-next {
    right: 30px !important;
}

.lightbox-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    background: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.lightbox-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.lightbox-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-portfolio h1::before {
        white-space: normal !important;
        line-height: 1.1 !important;
    }
    
    .hero-portfolio h1 {
        font-size: 4rem;
        margin-left: 20px;
    }
    
    .portfolio-filters {
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0 0.5rem;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        padding: 0 3px;
    }
    
    .portfolio-item {
        min-height: 150px;
    }
    
    .portfolio-item img {
        height: 150px;
        width: 100%;
        object-fit: cover;
    }
    
    .lightbox-nav {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
    }

    .lightbox-prev {
        left: 15px !important;
    }

    .lightbox-next {
        right: 15px !important;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .lightbox-info {
        position: relative;
        bottom: auto;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .hero-portfolio h1::before {
        white-space: normal !important;
        line-height: 1.1 !important;
    }
    
    .hero-portfolio h1 {
        font-size: 3rem;
        margin-left: 10px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 0 5px;
    }
    
    .portfolio-item {
        min-height: 200px;
    }
    
    .portfolio-item img {
        height: 200px;
        width: 100%;
        object-fit: cover;
    }
}

/* Clean up conflicting styles */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

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

.view-project {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
}