/**
 * MetisCari Popup/Optin Eklentisi - Modern CSS Stilleri
 * Güzel, modern ve responsive tasarım
 */

/* CSS Variables - Kolay özelleştirme için */
:root {
    --popup-primary-color: #007bff;
    --popup-secondary-color: #6c757d;
    --popup-success-color: #28a745;
    --popup-danger-color: #dc3545;
    --popup-warning-color: #ffc107;
    --popup-info-color: #17a2b8;
    --popup-light-color: #f8f9fa;
    --popup-dark-color: #343a40;
    --popup-white: #ffffff;
    --popup-black: #000000;
    
    --popup-border-radius: 12px;
    --popup-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --popup-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --popup-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --popup-font-size: 16px;
    --popup-line-height: 1.6;
}

/* Popup Overlay - Ana kapsayıcı */
.metis-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--popup-font-family);
    font-size: var(--popup-font-size);
    line-height: var(--popup-line-height);
    backdrop-filter: blur(5px);
}

.metis-popup-overlay.active {
    display: flex;
}

/* Overlay Background */
.popup-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    cursor: pointer;
    transition: var(--popup-transition);
}

/* Ana Popup Container */
.metis-popup {
    position: relative;
    background: var(--popup-bg-color, var(--popup-white));
    color: var(--popup-text-color, var(--popup-dark-color));
    border-radius: var(--popup-border-radius);
    box-shadow: var(--popup-box-shadow);
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    z-index: 1000000;
    transition: var(--popup-transition);
    transform: scale(0.9);
    opacity: 0;
    width: auto;
    min-width: var(--popup-width, 400px);
}

.metis-popup-overlay.active .metis-popup {
    transform: scale(1);
    opacity: 1;
}

/* Popup Boyutları */
.metis-popup {
    width: auto;
    min-width: var(--popup-width, 400px);
    max-width: var(--popup-max-width, 90vw);
    min-height: var(--popup-height, auto);
}

/* Popup Tipleri */
.popup-modal {
    width: auto;
    min-width: var(--popup-width, 500px);
    max-width: 90vw;
}

.popup-slide-in {
    width: var(--popup-width, 400px);
    max-width: 350px;
}

.popup-bar {
    width: 100%;
    max-width: none;
    border-radius: 0;
}

.popup-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* Pozisyon Sınıfları */
.position-center {
    /* Varsayılan - flex ile ortalanır */
}

.position-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
}

.position-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
}

.position-bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
}

.position-bottom-right {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.position-top-center {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.position-bottom-center {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Kapatma Butonu - Modern ve Görünür */
.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    font-size: 24px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--popup-transition);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.popup-close-btn:hover {
    background: #fff;
    color: var(--popup-danger-color);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.popup-close-btn:active {
    transform: scale(0.95);
}

/* Popup İçeriği */
.popup-content {
    padding: 40px;
    overflow: visible;
    max-height: none;
    width: fit-content;
    min-width: 300px;
}

.popup-bar .popup-content {
    padding: 20px 40px;
}

.popup-slide-in .popup-content {
    padding: 30px;
}

/* Başlık Stilleri */
.popup-content h1,
.popup-content h2,
.popup-content h3,
.popup-content h4,
.popup-content h5,
.popup-content h6 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.popup-content h1 { font-size: 2.5em; }
.popup-content h2 { font-size: 2em; }
.popup-content h3 { font-size: 1.75em; }
.popup-content h4 { font-size: 1.5em; }
.popup-content h5 { font-size: 1.25em; }
.popup-content h6 { font-size: 1.1em; }

/* Paragraf Stilleri */
.popup-content p {
    margin-bottom: 20px;
    color: inherit;
    opacity: 0.9;
}

/* Form Stilleri - Ana Container */
.metis-popup-form,
.popup-form {
    margin-top: 30px;
}

/* Form Field Container */
.form-field {
    margin-bottom: 25px;
    position: relative;
}

.form-field:last-child {
    margin-bottom: 0;
}

/* Label Stilleri */
.form-field label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--popup-text-color, var(--popup-dark-color));
    font-size: 15px;
}

.form-field label .required {
    color: var(--popup-danger-color);
    margin-left: 3px;
}

/* Input Stilleri - Modern ve Güzel */
.form-control,
.popup-form input,
.popup-form textarea,
.popup-form select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fafbfc;
    color: var(--popup-dark-color);
    transition: var(--popup-transition);
    box-sizing: border-box;
    outline: none;
}

.form-control:focus,
.popup-form input:focus,
.popup-form textarea:focus,
.popup-form select:focus {
    border-color: var(--popup-button-color, var(--popup-primary-color));
    background-color: var(--popup-white);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.form-control:hover,
.popup-form input:hover,
.popup-form textarea:hover,
.popup-form select:hover {
    border-color: #d1d9e0;
    background-color: var(--popup-white);
}

.form-control::placeholder,
.popup-form input::placeholder,
.popup-form textarea::placeholder {
    color: #8e9aaf;
    opacity: 1;
}

/* Textarea Özel Stilleri */
textarea.form-control,
.popup-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Select Özel Stilleri */
select.form-control,
.popup-form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 50px;
}

/* Checkbox ve Radio Stilleri */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.form-check:last-child {
    margin-bottom: 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--popup-button-color, var(--popup-primary-color));
}

.form-check-label {
    cursor: pointer;
    font-size: 15px;
    margin-bottom: 0 !important;
    display: block;
}

/* Submit Button Stilleri - Modern ve Çekici */
.popup-submit-btn,
.popup-form button[type="submit"] {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--popup-button-color, var(--popup-primary-color)), #0056b3);
    color: var(--popup-button-text-color, var(--popup-white));
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--popup-transition);
    margin-top: 25px;
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.popup-submit-btn::before,
.popup-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.popup-submit-btn:hover,
.popup-form button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.3);
}

.popup-submit-btn:hover::before,
.popup-form button[type="submit"]:hover::before {
    left: 100%;
}

.popup-submit-btn:active,
.popup-form button[type="submit"]:active {
    transform: translateY(-1px);
}

.popup-submit-btn:disabled,
.popup-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Hata Mesajları */
.field-error {
    color: var(--popup-danger-color);
    font-size: 14px;
    margin-top: 8px;
    display: block;
    font-weight: 500;
}

.form-control.error,
.popup-form input.error,
.popup-form textarea.error {
    border-color: var(--popup-danger-color);
    background-color: #fff5f5;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* Başarı Mesajları */
.popup-success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #c3e6cb;
    font-weight: 500;
    text-align: center;
}

/* Loading State */
.popup-loading {
    position: relative;
    pointer-events: none;
}

.popup-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* Animasyonlar */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    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% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animasyon Sınıfları */
.animation-fade .metis-popup {
    animation: fadeIn 0.4s ease-out;
}

.animation-slide-down .metis-popup {
    animation: slideInDown 0.5s ease-out;
}

.animation-slide-up .metis-popup {
    animation: slideInUp 0.5s ease-out;
}

.animation-slide-left .metis-popup {
    animation: slideInLeft 0.5s ease-out;
}

.animation-slide-right .metis-popup {
    animation: slideInRight 0.5s ease-out;
}

.animation-zoom .metis-popup {
    animation: zoomIn 0.4s ease-out;
}

.animation-bounce .metis-popup {
    animation: bounceIn 0.7s ease-out;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .metis-popup {
        width: auto !important;
        min-width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px;
    }
    
    .popup-content {
        padding: 25px;
        width: auto;
        min-width: auto;
    }
    
    .popup-bar .popup-content {
        padding: 15px 25px;
    }
    
    .popup-slide-in .popup-content {
        padding: 25px;
    }
    
    .position-top-left,
    .position-top-right,
    .position-bottom-left,
    .position-bottom-right {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
    }
    
    .popup-close-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .form-control,
    .popup-form input,
    .popup-form textarea,
    .popup-form select {
        padding: 14px 18px;
        font-size: 16px; /* iOS zoom önleme */
    }
    
    .popup-submit-btn,
    .popup-form button[type="submit"] {
        padding: 16px 25px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 20px;
    }
    
    .popup-content h1 { font-size: 2em; }
    .popup-content h2 { font-size: 1.7em; }
    .popup-content h3 { font-size: 1.5em; }
}

/* Mobil Uyumsuz Popup'lar */
@media (max-width: 768px) {
    .no-mobile {
        display: none !important;
    }
}

/* Dark Mode Desteği */
@media (prefers-color-scheme: dark) {
    .metis-popup {
        background: var(--popup-bg-color, #2d3748);
        color: var(--popup-text-color, #e2e8f0);
    }
    
    .form-control,
    .popup-form input,
    .popup-form textarea,
    .popup-form select {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .form-control:focus,
    .popup-form input:focus,
    .popup-form textarea:focus,
    .popup-form select:focus {
        background-color: #2d3748;
        border-color: var(--popup-button-color, var(--popup-primary-color));
    }
    
    .popup-close-btn {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
    
    .popup-close-btn:hover {
        background: #2d3748;
        color: var(--popup-danger-color);
    }
}

/* Print Stilleri */
@media print {
    .metis-popup-overlay {
        display: none !important;
    }
}

/* Accessibility İyileştirmeleri */
.metis-popup:focus {
    outline: 3px solid var(--popup-primary-color);
    outline-offset: 2px;
}

.popup-close-btn:focus {
    outline: 3px solid var(--popup-primary-color);
    outline-offset: 2px;
}

.form-control:focus,
.popup-form input:focus,
.popup-form textarea:focus,
.popup-form select:focus {
    outline: none;
}

/* Yüksek Kontrast Modu */
@media (prefers-contrast: high) {
    .form-control,
    .popup-form input,
    .popup-form textarea,
    .popup-form select {
        border-width: 3px;
    }
    
    .popup-submit-btn,
    .popup-form button[type="submit"] {
        border: 3px solid currentColor;
    }
}

/* Reduced Motion Desteği */
@media (prefers-reduced-motion: reduce) {
    .metis-popup,
    .popup-close-btn,
    .form-control,
    .popup-form input,
    .popup-form textarea,
    .popup-form select,
    .popup-submit-btn,
    .popup-form button[type="submit"] {
        transition: none;
    }
    
    .metis-popup {
        animation: none;
    }
}

/* Özel Popup Tipleri için Ek Stiller */
.popup-newsletter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.popup-newsletter .form-control,
.popup-newsletter .popup-form input,
.popup-newsletter .popup-form textarea {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #333;
}

.popup-newsletter .popup-submit-btn,
.popup-newsletter .popup-form button[type="submit"] {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    backdrop-filter: blur(10px);
}

.popup-newsletter .popup-submit-btn:hover,
.popup-newsletter .popup-form button[type="submit"]:hover {
    background: white;
    color: #667eea;
}

.popup-discount {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.popup-discount .popup-submit-btn,
.popup-discount .popup-form button[type="submit"] {
    background: #4ecdc4;
    color: white;
}

.popup-survey {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Contact Form Özel Stilleri */
.contact-form {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.contact-form h3 {
    color: #495057;
    text-align: center;
    margin-bottom: 10px;
}

.contact-form p {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
}

/* Discount Popup Özel Stilleri */
.discount-popup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.discount-badge {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.discount-popup h3 {
    margin-bottom: 15px;
    font-size: 1.8em;
}

.discount-popup p {
    margin-bottom: 25px;
    opacity: 0.95;
    font-size: 1.1em;
}

/* Yan Yana Form Alanları */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.form-row .form-field {
    flex: 1;
    margin-bottom: 0;
}

.form-row-inline {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.form-row-inline .form-field {
    flex: 1;
    margin-bottom: 0;
}

/* İki Kolon Layout */
.form-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-two-column .form-field {
    margin-bottom: 0;
}

/* Üç Kolon Layout */
.form-three-column {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.form-three-column .form-field {
    margin-bottom: 0;
}

/* Call Me Back Form Özel Stilleri */
.call-back-form {
    background: linear-gradient(135deg, #52c41a, #389e0d);
    color: white;
}

.call-back-form h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.call-back-form .phone-icon {
    font-size: 1.2em;
    color: #fff;
}

.call-back-form .form-control,
.call-back-form .popup-form input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #333;
}

.call-back-form .popup-submit-btn,
.call-back-form .popup-form button[type="submit"] {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    backdrop-filter: blur(10px);
}

.call-back-form .popup-submit-btn:hover,
.call-back-form .popup-form button[type="submit"]:hover {
    background: white;
    color: #52c41a;
}

/* Sadece Resim Popup Stilleri */
.image-only-popup {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.image-only-popup .popup-content {
    padding: 0;
    position: relative;
}

.image-only-popup img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--popup-border-radius);
}

.image-only-popup .popup-close-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    top: 10px;
    right: 10px;
}

.image-only-popup .popup-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    color: white;
}

/* Responsive Yan Yana Form Alanları */
@media (max-width: 768px) {
    .form-row,
    .form-row-inline {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-field,
    .form-row-inline .form-field {
        margin-bottom: 25px;
    }
    
    .form-row .form-field:last-child,
    .form-row-inline .form-field:last-child {
        margin-bottom: 0;
    }
    
    .form-two-column {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-two-column .form-field {
        margin-bottom: 25px;
    }
    
    .form-two-column .form-field:last-child {
        margin-bottom: 0;
    }
    
    .form-three-column {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-three-column .form-field {
        margin-bottom: 25px;
    }
    
    .form-three-column .form-field:last-child {
        margin-bottom: 0;
    }
}

/* Kompakt Form Stilleri */
.compact-form .form-field {
    margin-bottom: 20px;
}

.compact-form .form-control,
.compact-form .popup-form input,
.compact-form .popup-form textarea {
    padding: 12px 16px;
    font-size: 15px;
}

.compact-form .popup-submit-btn,
.compact-form .popup-form button[type="submit"] {
    padding: 14px 25px;
    font-size: 16px;
    margin-top: 20px;
}