/* Popup Plugin CSS */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-container {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.popup-header {
    position: relative;
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid #eee;
}

.popup-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.2;
    display: block;
    width: 100%;
}

/* Mobil başlık hizalama - Çok güçlü kurallar */
@media (max-width: 768px) {
    /* Data attribute ile */
    .popup-container[data-mobile-title-align="left"] .popup-header,
    .popup-header[data-mobile-title-align="left"] {
        text-align: left !important;
    }
    
    .popup-container[data-mobile-title-align="left"] .popup-title,
    .popup-header[data-mobile-title-align="left"] .popup-title {
        text-align: left !important;
    }
    
    .popup-container[data-mobile-title-align="center"] .popup-header,
    .popup-header[data-mobile-title-align="center"] {
        text-align: center !important;
    }
    
    .popup-container[data-mobile-title-align="center"] .popup-title,
    .popup-header[data-mobile-title-align="center"] .popup-title {
        text-align: center !important;
    }
    
    .popup-container[data-mobile-title-align="right"] .popup-header,
    .popup-header[data-mobile-title-align="right"] {
        text-align: right !important;
    }
    
    .popup-container[data-mobile-title-align="right"] .popup-title,
    .popup-header[data-mobile-title-align="right"] .popup-title {
        text-align: right !important;
    }
    
    /* Class ile */
    .popup-header.mobile-left {
        text-align: left !important;
    }
    
    .popup-header.mobile-left .popup-title {
        text-align: left !important;
    }
    
    .popup-header.mobile-center {
        text-align: center !important;
    }
    
    .popup-header.mobile-center .popup-title {
        text-align: center !important;
    }
    
    .popup-header.mobile-right {
        text-align: right !important;
    }
    
    .popup-header.mobile-right .popup-title {
        text-align: right !important;
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.popup-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    line-height: 1.6;
}

.popup-content.content-left {
    text-align: left !important;
}

.popup-content.content-center {
    text-align: center !important;
}

.popup-content.content-right {
    text-align: right !important;
}

.popup-content.content-justify {
    text-align: justify !important;
}

.popup-content p {
    margin: 0 0 15px 0;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

.popup-content img {
    max-width: 100%;
    height: auto;
}

.popup-footer {
    padding: 10px 20px 20px 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.popup-button {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-width: 120px;
}

.popup-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animasyonlar */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive tasarım */
@media (max-width: 768px) {
    .popup-container {
        width: 95vw !important;
        height: auto !important;
        max-height: 85vh;
        min-height: 40vh;
        margin: 20px;
        display: flex;
        flex-direction: column;
        font-family: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
    }
    
    /* Tablet'te hizalama kontrolleri - Başlık inline style ile kontrol ediliyor */
    
    .popup-content.content-left {
        text-align: left !important;
    }
    
    .popup-content.content-center {
        text-align: center !important;
    }
    
    .popup-content.content-right {
        text-align: right !important;
    }
    
    .popup-content.content-justify {
        text-align: justify !important;
    }
    
    .popup-header {
        padding: 15px 15px 10px 15px;
        flex-shrink: 0;
    }
    
    .popup-title {
        font-size: 1.3em !important;
    }
    
    .popup-header.title-left .popup-title {
        text-align: left !important;
    }
    
    .popup-header.title-center .popup-title {
        text-align: center !important;
    }
    
    .popup-header.title-right .popup-title {
        text-align: right !important;
    }
    
    .popup-content {
        padding: 15px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .popup-content.content-left {
        text-align: left !important;
    }
    
    .popup-content.content-center {
        text-align: center !important;
    }
    
    .popup-content.content-right {
        text-align: right !important;
    }
    
    .popup-content.content-justify {
        text-align: justify !important;
    }
    
    .popup-footer {
        padding: 10px 15px 15px 15px;
        flex-shrink: 0;
    }
    
    .popup-button {
        width: 100%;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 100vw !important;
        height: auto !important;
        max-height: 90vh;
        min-height: 50vh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        font-family: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
    }
    
    /* Mobilde hizalama kontrolleri - Başlık inline style ile kontrol ediliyor */
    
    .popup-content.content-left {
        text-align: left !important;
    }
    
    .popup-content.content-center {
        text-align: center !important;
    }
    
    .popup-content.content-right {
        text-align: right !important;
    }
    
    .popup-content.content-justify {
        text-align: justify !important;
    }
    
    /* Mobil yükseklik ayarları */
    .popup-container[data-mobile-height="200"] {
        height: 200px !important;
        min-height: 200px !important;
    }
    
    .popup-container[data-mobile-height="300"] {
        height: 300px !important;
        min-height: 300px !important;
    }
    
    .popup-container[data-mobile-height="400"] {
        height: 400px !important;
        min-height: 400px !important;
    }
    
    .popup-container[data-mobile-height="500"] {
        height: 500px !important;
        min-height: 500px !important;
    }
    
    .popup-container[data-mobile-height="600"] {
        height: 600px !important;
        min-height: 600px !important;
    }
    
    .popup-container[data-mobile-height="700"] {
        height: 700px !important;
        min-height: 700px !important;
    }
    
    .popup-container[data-mobile-height="800"] {
        height: 800px !important;
        min-height: 800px !important;
    }
    
    .popup-header {
        padding: 20px 20px 15px 20px;
        flex-shrink: 0;
    }
    
    .popup-title {
        font-size: 1.2em !important;
    }
    
    .popup-header.title-left .popup-title {
        text-align: left !important;
    }
    
    .popup-header.title-center .popup-title {
        text-align: center !important;
    }
    
    .popup-header.title-right .popup-title {
        text-align: right !important;
    }
    
    .popup-content {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .popup-content.content-left {
        text-align: left !important;
    }
    
    .popup-content.content-center {
        text-align: center !important;
    }
    
    .popup-content.content-right {
        text-align: right !important;
    }
    
    .popup-content.content-justify {
        text-align: justify !important;
    }
    
    .popup-footer {
        padding: 15px 20px 20px 20px;
        flex-shrink: 0;
    }
}

/* Admin paneli için ek stiller */
.popup-preview {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.popup-preview h3 {
    margin-top: 0;
    color: #333;
}

#popup-preview {
    border: 2px dashed #ccc;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

#popup-preview h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#popup-preview button {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

/* Form stilleri */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="url"],
.form-table input[type="number"] {
    width: 100%;
    max-width: 400px;
}

.form-table input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-table .description {
    font-style: italic;
    color: #666;
    margin-top: 5px;
}

/* Checkbox stilleri */
.form-table input[type="checkbox"] {
    margin-right: 8px;
}

.form-table label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}

/* Submit butonu */
.submit {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Mesaj stilleri */
#save-message {
    font-weight: 600;
}

/* WordPress admin stilleri ile uyumluluk */
.wrap h1 {
    color: #23282d;
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px 0;
    line-height: 1.3;
}

.wrap h2 {
    font-size: 18px;
    margin: 25px 0 15px 0;
    color: #23282d;
}

.wrap h3 {
    font-size: 16px;
    margin: 20px 0 10px 0;
    color: #23282d;
}
