/* PDF Grid Widget Styles - Super PDF Pop Up Tasarımı */
.pdf-grid-widget {
    width: 100%;
}

/* Main Box - Super PDF Pop Up Tarzı */
.pdf-main-box {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    will-change: transform, box-shadow;
    border-radius: 12px;
}

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

/* Background Image */
.pdf-main-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%) brightness(0.8);
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.pdf-main-box:hover .pdf-main-bg-image {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* Overlay */
.pdf-main-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    backdrop-filter: blur(0px);
}

.pdf-main-box:hover .pdf-main-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    backdrop-filter: blur(2px);
}

/* Title */
.pdf-main-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.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 0.9;
}

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

/* Modal Styles - FIXED */
.pdf-grid-modal {
    display: none;
    position: fixed !important;
    z-index: 999999 !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    background-color: rgba(0, 0, 0, 0.95);
    margin: 0 !important;
    padding: 0 !important;
}

.pdf-grid-modal.show {
    display: block !important;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.pdf-grid-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-color: #fefefe;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1000000 !important;
    margin: 0 auto !important;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Close Button */
.pdf-grid-close {
    color: #333;
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
    opacity: 0.9;
    background: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    line-height: 1;
}

.pdf-grid-close:hover,
.pdf-grid-close:focus {
    color: #000;
    transform: rotate(90deg);
    opacity: 1;
    text-decoration: none;
    background: #f0f0f0;
}

/* Modal Wrapper */
.pdf-modal-wrapper {
    background-color: #fefefe;
}

/* Modal Title */
.pdf-modal-title {
    color: #333;
    font-size: 2rem;
    margin: 0 0 30px 0;
    text-align: center;
    font-weight: 600;
}

/* PDF Cards Grid */
.pdf-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 20px 0;
}

@media (max-width: 1024px) {
    .pdf-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pdf-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* PDF Card - Grid içindeki kartlar */
.pdf-card {
    position: relative;
    height: 300px;
    overflow: hidden;
    cursor: pointer !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    will-change: transform, box-shadow;
    border-radius: 12px;
    background-color: #f0f0f0;
    display: block;
    pointer-events: auto !important;
}

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

/* Card Image */
.pdf-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%) brightness(0.8);
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
    pointer-events: none;
}

.pdf-card:hover .pdf-card-image {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* Card Overlay */
.pdf-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    backdrop-filter: blur(0px);
    pointer-events: none;
}

.pdf-card:hover .pdf-card-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    backdrop-filter: blur(2px);
}

/* Card Title */
.pdf-card-title {
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    font-family: inherit;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 0.9;
    pointer-events: none;
}

.pdf-card:hover .pdf-card-title {
    transform: translateY(-3px);
    opacity: 1;
}

/* PDF Viewer Wrapper */
.pdf-viewer-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fefefe;
    display: none;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
    box-sizing: border-box;
}

/* Back Button */
.pdf-back-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    background-color: transparent;
    color: #333;
    border: 2px solid #333;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 20px;
    align-self: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.pdf-back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: #333;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.pdf-back-button:hover {
    color: #ffffff;
    transform: translateX(-5px);
}

.pdf-back-button:hover::before {
    width: 100%;
}

/* PDF Viewer */
.pdf-viewer-iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 8px;
    background-color: #f5f5f5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-main-box {
        height: 250px;
    }
    
    .pdf-grid-modal-content {
        width: 95%;
        height: 85vh;
        max-height: 85vh;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .pdf-modal-wrapper {
        padding: 20px;
    }
    
    .pdf-modal-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .pdf-card {
        height: 250px;
    }
    
    .pdf-main-title,
    .pdf-card-title {
        font-size: 18px;
        padding: 15px;
    }
    
    .pdf-grid-close {
        top: -35px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .pdf-main-box {
        height: 200px;
    }
    
    .pdf-main-title {
        font-size: 16px;
    }
    
    .pdf-card {
        height: 200px;
    }
    
    .pdf-card-title {
        font-size: 16px;
        padding: 15px;
    }
}

/* Modal açıkken body stilleri - FIXED */
html.pdf-modal-open,
html.pdf-modal-open body {
    overflow: hidden !important;
    height: 100% !important;
}

body.pdf-modal-open {
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Yüksek öncelikli z-index düzeltmeleri */
body > .pdf-grid-modal {
    z-index: 2147483647 !important; /* Maximum z-index */
    position: fixed !important;
    inset: 0 !important;
}

body > .pdf-grid-modal .pdf-grid-modal-content {
    z-index: 2147483648 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Elementor editör uyumluluğu */
.elementor-editor-active .pdf-grid-modal {
    z-index: 9999999 !important;
}

/* Modal açıkken scroll engelleme */
.pdf-grid-modal.show {
    position: fixed !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

/* Modal içeriği scroll ayarları */
.pdf-modal-wrapper {
    position: relative !important;
    height: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 40px !important;
    box-sizing: border-box !important;
}

/* Viewport kilitleme */
html.pdf-modal-open {
    overflow: hidden !important;
    height: 100% !important;
    position: relative !important;
}