/* CloudPano Single Button - Tam Güncellenmiş Stil Dosyası */
/* Afraze Sanal Tur - Beyaz Yazı + Tam Yuvarlak Çarpı İkonu */

/* Wrapper */
.cpsb-wrapper {
    display: block;
    margin: 10px 0;
}

.cpsb-width-inline .cpsb-button {
    display: inline-flex;
    width: auto;
}

.cpsb-width-full .cpsb-button {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Buton - Tam İstediğiniz Özellikler */
.cpsb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px; /* İstediğiniz boyutlar */
    background-color: #3A634A; /* İstediğiniz renk */
    color: #ffffff;
    border: 1px solid #000000; /* 1px siyah kenarlık */
    border-radius: 25px; /* Oval köşeler */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(58, 99, 74, 0.3);
    line-height: 1;
    outline: none;
}

/* Hover Efektleri */
.cpsb-hover-lift .cpsb-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(58, 99, 74, 0.4);
    background-color: #2f5439;
}

.cpsb-hover-scale .cpsb-button:hover {
    transform: scale(1.05);
    background-color: #2f5439;
}

.cpsb-hover-glow .cpsb-button:hover {
    box-shadow: 0 0 20px rgba(58, 99, 74, 0.6);
    background-color: #2f5439;
}

.cpsb-button:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s;
}

/* Modal - Slide From Up Efekti */
#cpsbModal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#cpsbModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cpsbFadeIn 0.3s ease;
}

@keyframes cpsbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cpsb-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.cpsb-dialog {
    position: relative;
    width: min(96vw, 1200px);
    height: min(90vh, 800px);
    background: #1a1a1a;
    border-radius: 20px; /* Modal da oval köşeli */
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    transform: translateY(-100px); /* Slide from up başlangıç */
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
               opacity 0.3s ease;
}

#cpsbModal.active .cpsb-dialog {
    transform: translateY(0); /* Slide from up hedef */
    opacity: 1;
}

/* Header - Afraze Sanal Tur BEYAZ YAZI */
.cpsb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3A634A, #2f5439);
    color: white;
    border-radius: 20px 20px 0 0;
}

.cpsb-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff !important; /* BEYAZ YAZI ZORLA */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpsb-header h3 * {
    color: #ffffff !important; /* Tüm alt elementler beyaz */
}

/* Estetik TAM YUVARLAK Çarpı İkonu - DÖNME YOK */
.cpsb-close {
    width: 44px;
    height: 44px;
    min-width: 44px; /* Minimum boyut garantisi */
    min-height: 44px; /* Minimum boyut garantisi */
    border: none;
    border-radius: 50% !important; /* TAM YUVARLAK ZORLA */
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    font-size: 0;
    outline: none;
    box-sizing: border-box; /* Tam yuvarlak garantisi */
    aspect-ratio: 1 / 1; /* 1:1 oran zorla - mükemmel daire */
    flex-shrink: 0; /* Küçülmeyi engelle */
    position: relative;
}

.cpsb-close::before {
    content: "✕";
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    color: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cpsb-close:hover {
    transform: scale(1.1); /* SADECE BÜYÜME - DÖNME YOK */
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ff5252, #d32f2f);
}

.cpsb-close:active {
    transform: scale(1.05);
    transition: transform 0.1s;
}

.cpsb-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Content */
.cpsb-content {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 0 0 20px 20px;
}

.cpsb-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 0 0 20px 20px;
}

/* Loading Göstergesi */
.cpsb-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: opacity 0.4s ease;
    border-radius: 0 0 20px 20px;
}

.cpsb-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #3A634A;
    z-index: 2;
}

.cpsb-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(58, 99, 74, 0.2);
    border-top-color: #3A634A;
    border-radius: 50%;
    animation: cpsbSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cpsbSpin {
    to { transform: rotate(360deg); }
}

.cpsb-loading p {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #3A634A;
}

.cpsb-content.loaded::before,
.cpsb-content.loaded .cpsb-loading {
    opacity: 0;
    pointer-events: none;
}

/* Fallback - Hata Durumu */
.cpsb-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    padding: 40px;
    text-align: center;
    z-index: 3;
    color: white;
    border-radius: 0 0 20px 20px;
}

.cpsb-fallback.show {
    display: flex;
}

.cpsb-fallback h4 {
    color: #ff6b6b;
    font-size: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cpsb-fallback p {
    margin-bottom: 24px;
    color: #ccc;
    font-size: 16px;
    line-height: 1.6;
    max-width: 400px;
}

.cpsb-fallback a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #3A634A;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(58, 99, 74, 0.3);
}

.cpsb-fallback a:hover {
    background: #2f5439;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(58, 99, 74, 0.4);
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .cpsb-dialog {
        width: 98vw;
        height: 92vh;
        border-radius: 15px;
    }
    
    .cpsb-header {
        padding: 14px 16px;
        border-radius: 15px 15px 0 0;
    }
    
    .cpsb-header h3 {
        font-size: 18px;
        color: #ffffff !important; /* Mobilde de beyaz */
    }
    
    .cpsb-header h3 * {
        color: #ffffff !important;
    }
    
    .cpsb-close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 / 1;
    }
    
    .cpsb-close::before {
        font-size: 18px;
    }
    
    .cpsb-content,
    .cpsb-content iframe,
    .cpsb-fallback,
    .cpsb-content::before {
        border-radius: 0 0 15px 15px;
    }
}

@media (max-width: 480px) {
    .cpsb-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .cpsb-header {
        border-radius: 0;
    }
    
    .cpsb-header h3 {
        font-size: 16px;
        color: #ffffff !important; /* Küçük mobilde de beyaz */
    }
    
    .cpsb-header h3 * {
        color: #ffffff !important;
    }
    
    .cpsb-close {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 / 1;
    }
    
    .cpsb-close::before {
        font-size: 16px;
    }
    
    .cpsb-content,
    .cpsb-content iframe,
    .cpsb-fallback,
    .cpsb-content::before {
        border-radius: 0;
    }
    
    .cpsb-fallback {
        padding: 24px;
    }
    
    .cpsb-fallback h4 {
        font-size: 20px;
    }
    
    .cpsb-fallback p {
        font-size: 14px;
    }
}

/* Erişilebilirlik - Hareket Azaltma */
@media (prefers-reduced-motion: reduce) {
    .cpsb-button,
    .cpsb-close,
    #cpsbModal,
    .cpsb-dialog,
    .cpsb-spinner {
        animation: none !important;
        transition: none !important;
    }
    
    .cpsb-button:hover,
    .cpsb-close:hover {
        transform: none !important;
    }
}

/* Yüksek Kontrast Modu Desteği */
@media (prefers-contrast: high) {
    .cpsb-button {
        border: 2px solid #000000;
    }
    
    .cpsb-close {
        border: 2px solid #ffffff;
    }
    
    .cpsb-header h3 {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    }
}

/* Dark Mode Uyumluluğu */
@media (prefers-color-scheme: dark) {
    .cpsb-header h3 {
        color: #ffffff !important;
        text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    }
}

/* Print Medya - Modal Gizle */
@media print {
    #cpsbModal {
        display: none !important;
    }
}

/* Çok Yüksek Çözünürlük Desteği */
@media (min-width: 1400px) {
    .cpsb-dialog {
        max-width: 1400px;
        max-height: 900px;
    }
}

/* Çok Küçük Ekranlar (Akıllı Saatler vb.) */
@media (max-width: 320px) {
    .cpsb-close {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    .cpsb-close::before {
        font-size: 14px;
    }
    
    .cpsb-header h3 {
        font-size: 14px;
    }
}

/* Focus Yönetimi - Erişilebilirlik */
.cpsb-button:focus,
.cpsb-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animasyon Performans Optimizasyonu */
.cpsb-button,
.cpsb-close,
.cpsb-dialog {
    will-change: transform;
}

#cpsbModal.active .cpsb-dialog {
    will-change: auto;
}

/* Son Dokunuşlar - Z-index Yönetimi */
#cpsbModal {
    z-index: 999999;
}

.cpsb-backdrop {
    z-index: 1;
}

.cpsb-dialog {
    z-index: 2;
}

.cpsb-loading {
    z-index: 10;
}

.cpsb-fallback {
    z-index: 11;
}
