.pdf-popup-widget {
    width: 100%;
}

/* Smooth hover animations */

.pdf-popup-box {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease-out,
                box-shadow 0.3s ease-out;
    z-index: 1;
    transform: translateY(0) translateZ(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    will-change: transform;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.pdf-popup-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.pdf-popup-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: filter 0.4s ease-out,
                transform 0.4s ease-out;
    transform: scale(1) translateZ(0);
    will-change: transform, filter;
    backface-visibility: hidden;
}

/* Apply grayscale only when has-grayscale class is present */
.pdf-popup-box.has-grayscale .pdf-popup-bg-image {
    filter: grayscale(100%) brightness(0.8);
}

/* Apply hover colorize only when has-hover-colorize class is present */
.pdf-popup-box.has-grayscale.has-hover-colorize:hover .pdf-popup-bg-image {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* No hover filter change if hover colorize is disabled */
.pdf-popup-box.has-grayscale:not(.has-hover-colorize):hover .pdf-popup-bg-image {
    filter: grayscale(100%) brightness(0.8);
    transform: scale(1.05);
}

/* No filter when grayscale is disabled */
.pdf-popup-box:not(.has-grayscale) .pdf-popup-bg-image {
    filter: none;
}

.pdf-popup-box:hover .pdf-popup-bg-image {
    transform: scale(1.05);
}

.pdf-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease-out, background 0.3s ease-out;
    z-index: 2;
}

/* Gradient overlay hover (default) */
.overlay-type-gradient .pdf-popup-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.overlay-type-gradient:hover .pdf-popup-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
}

/* Solid overlay hover - will be handled by JavaScript */

/* Transparent overlay */
.overlay-type-transparent .pdf-popup-overlay {
    background: transparent !important;
}

.overlay-type-transparent:hover .pdf-popup-overlay {
    background: transparent !important;
}

.pdf-popup-title {
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    font-family: inherit;
    transition: transform 0.3s ease-out,
                opacity 0.3s ease-out;
    transform: translateY(0) translateZ(0);
    opacity: 0.9;
}

.pdf-popup-box:hover .pdf-popup-title {
    transform: translateY(-3px) translateZ(0);
    opacity: 1;
}

.pdf-popup-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0);
    animation: modalFadeIn 0.4s ease-out forwards;
    backdrop-filter: blur(0px);
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        background-color: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(5px);
    }
}

.pdf-popup-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: translateY(100px) scale(0.8);
    opacity: 0;
}

@keyframes modalSlideIn {
    0% {
        transform: translateY(100px) scale(0.8);
        opacity: 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    60% {
        transform: translateY(-10px) scale(1.02);
        opacity: 0.9;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    }
}

.pdf-popup-close {
    color: #fff;
    position: absolute;
    top: -60px;
    right: -10px;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    z-index: 100001;
    transition: transform 0.3s ease-out,
                color 0.3s ease-out,
                background-color 0.3s ease-out;
    transform: rotate(0deg);
    opacity: 0.9;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    touch-action: manipulation;
    line-height: 1;
}

.pdf-popup-close:hover,
.pdf-popup-close:focus {
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
    opacity: 1;
    text-decoration: none;
    background-color: rgba(255, 0, 0, 0.6);
    outline: none;
}

.pdf-popup-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

/* Loading spinner */
.pdf-popup-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 10;
}

.pdf-popup-loading::after {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 6px;
    border-radius: 50%;
    border: 6px solid #667eea;
    border-color: #667eea transparent #667eea transparent;
    animation: pdfLoading 1.2s linear infinite;
}

@keyframes pdfLoading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.pdf-popup-loading.hidden {
    display: none;
}

@media (max-width: 768px) {
    .pdf-popup-modal-content {
        width: 95%;
        margin: 5% auto;
        height: 85vh;
    }
    
    .pdf-popup-title {
        font-size: 18px;
        padding: 15px;
    }
    
    .pdf-popup-close {
        top: -50px;
        right: -5px;
        font-size: 24px;
        width: 50px;
        height: 50px;
    }
}

/* Modal kapatma animasyonu */
.pdf-popup-modal.closing {
    animation: modalFadeOut 0.3s ease-out forwards;
}

.pdf-popup-modal.closing .pdf-popup-modal-content {
    animation: modalSlideOut 0.3s ease-out forwards;
}

@keyframes modalFadeOut {
    0% {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(5px);
    }
    100% {
        opacity: 0;
        background-color: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
}

@keyframes modalSlideOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
}

/* Content wrapper */
.pdf-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 30px;
}

/* Icon styles */
.pdf-popup-icon {
    margin-bottom: 20px;
    transition: transform 0.3s ease-out,
                color 0.3s ease-out;
    transform: translateZ(0);
}

.pdf-popup-box:hover .pdf-popup-icon {
    transform: scale(1.1) translateZ(0);
}

/* Subtitle styles */
.pdf-popup-subtitle {
    margin: 10px 0 0 0;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.3s ease-out;
}

.pdf-popup-box:hover .pdf-popup-subtitle {
    opacity: 1;
}

/* Sexy Animations */
.has-sexy-animations {
    animation-fill-mode: both;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-10px) translateZ(0) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
}

.hover-zoom:hover {
    transform: scale(1.05) translateZ(0) !important;
}

.hover-zoom:hover .pdf-popup-bg-image {
    transform: scale(1.1) translateZ(0) !important;
}

.hover-rotate:hover {
    transform: perspective(1000px) rotateY(5deg) translateZ(0) !important;
}

.hover-flip:hover {
    transform: perspective(1000px) rotateY(180deg) translateZ(0) !important;
}

.hover-flip .pdf-popup-overlay {
    backface-visibility: hidden;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3),
                0 0 60px rgba(255, 255, 255, 0.2),
                0 0 90px rgba(255, 255, 255, 0.1) !important;
}

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.entrance-fadeInUp {
    animation: fadeInUp 1s ease-out;
}

.entrance-fadeInDown {
    animation: fadeInDown 1s ease-out;
}

.entrance-fadeInLeft {
    animation: fadeInLeft 1s ease-out;
}

.entrance-fadeInRight {
    animation: fadeInRight 1s ease-out;
}

.entrance-zoomIn {
    animation: zoomIn 0.8s ease-out;
}

.entrance-bounceIn {
    animation: bounceIn 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


/* Advanced hover animations - optimized */
.has-sexy-animations .pdf-popup-overlay {
    position: relative;
    overflow: hidden;
}

/* Removed sweep effect to reduce jank */

/* Pulse animation for icon - simplified */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1) translateZ(0);
    }
    50% {
        transform: scale(1.05) translateZ(0);
    }
}

.has-sexy-animations:hover .pdf-popup-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

/* Text glow effect on hover - lighter */
.has-sexy-animations:hover .pdf-popup-title {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Smooth transitions for all interactive elements */
.pdf-popup-box * {
    transition-timing-function: ease-out;
}