/**
* KANews Widget Admin Styles
* 
* @package KANews
* @subpackage Widgets
* @version 1.0.0
*/

/* Accordion Styles */
.kanews-accordion {
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
}

.kanews-accordion-header {
padding: 12px 15px;
background-color: #f5f5f5;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
transition: background-color 0.2s ease;
}

.kanews-accordion-header:hover {
background-color: #e9e9e9;
}

.kanews-accordion-title {
font-weight: 600;
color: #333;
}

.kanews-accordion-icon {
position: relative;
width: 20px;
height: 20px;
}

.kanews-accordion-icon:before,
.kanews-accordion-icon:after {
content: '';
position: absolute;
background-color: #666;
transition: transform 0.2s ease;
}

.kanews-accordion-icon:before {
top: 50%;
left: 0;
width: 100%;
height: 2px;
transform: translateY(-50%);
}

.kanews-accordion-icon:after {
top: 0;
left: 50%;
width: 2px;
height: 100%;
transform: translateX(-50%);
}

.kanews-accordion.is-active .kanews-accordion-icon:after {
transform: translateX(-50%) rotate(90deg);
}

.kanews-accordion-content {
padding: 15px;
background-color: #fff;
display: none;
}

.kanews-accordion.is-active .kanews-accordion-content {
display: block;
}

/* Field Styles */
.kanews-form-field {
margin-bottom: 15px;
}

.kanews-form-field label {
display: block;
margin-bottom: 8px;
font-weight: 600;
}

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

.kanews-field-label {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
font-weight: 600;
}

/* Select Styles */
.kanews-select,
.kanews-select2,
select.widefat {
width: 100% !important;
max-width: 100% !important;
margin-top: 5px;
height: 30px;
border: 1px solid #8c8f94;
border-radius: 4px;
padding: 0 8px;
background-color: #fff;
color: #2c3338;
font-size: 14px;
line-height: 2;
min-height: 30px;
box-shadow: 0 0 0 transparent;
}

.kanews-select:focus,
.kanews-select2:focus,
select.widefat:focus {
border-color: #2271b1;
box-shadow: 0 0 0 1px #2271b1;
outline: 2px solid transparent;
}

/* Select2 Styles */
.kanews-select2,
.select2-container {
width: 100% !important;
margin-top: 5px;
}

.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
width: 100% !important;
border: 1px solid #8c8f94;
border-radius: 4px;
min-height: 30px;
padding: 0 4px;
}

.select2-container--default .select2-selection--single {
padding: 0 24px 0 8px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 30px;
padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 30px;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #007cba;
border-color: #007cba;
color: #fff;
padding: 2px 6px;
margin: 3px 3px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #fff;
margin-right: 5px;
}

.select2-container--default .select2-search--inline .select2-search__field {
margin-top: 3px;
}

/* Slider Styles */
.kanews-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.kanews-slider {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    position: relative;
    margin: 0;
}

.kanews-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: #2271b1;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    margin-top: -9px;
    margin-left: -9px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 2;
}

.kanews-slider .ui-slider-range {
    background: #2271b1;
    height: 100%;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
}

.kanews-slider-value {
    min-width: 60px;
    padding: 4px 8px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    color: #50575e;
}

.kanews-slider-reset {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #f0f0f1;
    color: #50575e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.kanews-slider-reset:hover {
    background: #e0e0e0;
    color: #1d2327;
}

.kanews-slider-reset:before {
    content: "×";
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
}

/* Slider hover state */
.kanews-slider:hover .ui-slider-handle {
    background: #135e96;
}

/* Slider active state */
.kanews-slider .ui-slider-handle:active {
    background: #135e96;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Color Picker Styles */
.kanews-color-picker {
width: 100px;
}

.wp-picker-container {
display: inline-block;
}

/* Toggle Switch Styles */
.kanews-toggle-field {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
}

.kanews-toggle-header {
display: flex;
align-items: center;
gap: 8px;
}

.kanews-toggle-title {
display: flex;
align-items: center;
gap: 8px;
font-weight: 500;
color: #23282d;
}

.kanews-toggle-icon {
width: 24px;
height: 24px;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
position: relative;
transition: opacity 0.3s ease;
cursor: pointer;
}

.kanews-toggle-icon::after {
content: '';
position: absolute;
top: 50%;
left: -2px;
right: -2px;
height: 2px;
background-color: #666;
transform: scaleX(0) rotate(-45deg);
transform-origin: center;
transition: transform 0.3s ease;
}

.kanews-toggle-icon.is-active,
.kanews-toggle-field input[type="checkbox"]:checked ~ .kanews-toggle-header .kanews-toggle-icon {
opacity: 0.5;
}

.kanews-toggle-icon.is-active::after,
.kanews-toggle-field input[type="checkbox"]:checked ~ .kanews-toggle-header .kanews-toggle-icon::after {
transform: scaleX(1) rotate(-45deg);
}

.kanews-toggle-icon.desktop {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M21 2H3c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H3V4h18v16zM9 6h6v2H9zm0 4h6v2H9z"/></svg>');
}

.kanews-toggle-icon.mobile {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M17 1H7c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 18H7V5h10v14z"/></svg>');
}

.kanews-toggle-switch-wrapper {
margin-left: auto;
}

.kanews-toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}

.kanews-toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}

.kanews-toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 24px;
}

.kanews-toggle-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}

input:checked + .kanews-toggle-slider {
background-color: #2196F3;
}

input:checked + .kanews-toggle-slider:before {
transform: translateX(26px);
}

.kanews-toggle-label {
display: flex;
align-items: center;
margin-bottom: 10px;
}

.kanews-toggle-text {
font-weight: 500;
color: #23282d;
}

/* Responsive Styles */
@media screen and (max-width: 782px) {
.kanews-accordion-header {
padding: 10px;
}

.kanews-accordion-content {
padding: 10px;
}

.kanews-form-field label {
margin-bottom: 3px;
}
}

/* Tooltip Styles */
.kanews-tooltip-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
margin-left: 8px;
cursor: help;
color: #666;
position: relative;
}

.kanews-tooltip-icon:hover::before {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
right: 0;
transform: translateY(-5px);
padding: 5px 10px;
background: rgba(0, 0, 0, 0.8);
color: white;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
z-index: 1000;
}

.kanews-tooltip-icon:hover::after {
content: '';
position: absolute;
bottom: 100%;
right: 3px;
transform: translateY(0);
border: 5px solid transparent;
border-top-color: rgba(0, 0, 0, 0.8);
}

/* Radio Fields */
.kanews-radio-group {
margin: 10px 0;
}

.kanews-radio-label {
display: block;
margin: 5px 0;
cursor: pointer;
}

.kanews-radio-label input[type="radio"] {
margin-right: 8px;
}

/* Checkbox Fields */
.kanews-checkbox-label {
display: flex;
align-items: center;
margin: 5px 0;
cursor: pointer;
}

.kanews-checkbox-label input[type="checkbox"] {
margin-right: 8px;
}

.kanews-checkbox-text {
font-size: 13px;
line-height: 1.4;
}

/* Common styles for both radio and checkbox */
.kanews-radio-label:hover,
.kanews-checkbox-label:hover {
color: #2271b1;
}

.kanews-radio-label input[type="radio"]:checked + span,
.kanews-checkbox-label input[type="checkbox"]:checked + span {
color: #2271b1;
font-weight: 500;
} 

.kanews-field-wrapper {
margin-bottom: 1rem;
}

.widget-inside .widget-content>.kanews-field-wrapper:first-child {
margin-top: 1.5rem
}

/* Görünürlük Göstergeleri */
.kanews-visibility-indicators {
display: flex;
align-items: center;
gap: 8px;
position: absolute;
top: 11px;
right: 3em;
}

.kanews-visibility-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 24px;
height: 24px;
padding: 0 8px;
border-radius: 4px;
background-color: #f0f0f1;
border: 1px solid #dcdcde;
cursor: pointer;
transition: all 0.2s ease;
font-size: 12px;
font-weight: 500;
color: #50575e;
}

.kanews-visibility-mobile {
background-color: #0d47a1;
border-color: #1565c0;
color: #e3f2fd;
}

.kanews-visibility-mobile:hover {
background-color: #1565c0;
}

.kanews-visibility-desktop {
background-color: #1b5e20;
border-color: #2e7d32;
color: #e8f5e9;
}

.kanews-visibility-desktop:hover {
background-color: #2e7d32;
}

.kanews-visibility-width {
background-color: #4a148c;
border-color: #6a1b9a;
color: #f3e5f5;
}

.kanews-visibility-width:hover {
background-color: #6a1b9a;
}

/* Pasif Bileşen göstergesi */
.kanews-visibility-indicator.kanews-visibility-inactive {
background-color: #f5f5f5;
border-color: #e0e0e0;
color: #757575;
}

.kanews-visibility-indicator.kanews-visibility-inactive:hover {
background-color: #eeeeee;
}

/* Görünürlük Göstergeleri - Mobil */
@media screen and (max-width: 782px) {
.kanews-visibility-indicators {
margin-top: 8px;
}
.kanews-visibility-indicator {
min-width: 32px;
height: 32px;
padding: 0 12px;
font-size: 14px;
}
}


#widget-list .kanews-visibility-indicators {
    display: none !important;
}

.kanews-slider-element {
    flex: 1
}

/* Media Field Styles */
.kanews-field-wrapper-media {
    margin-bottom: 15px;
}

.kanews-media-field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kanews-media-field input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.kanews-field-media-preview {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.kanews-field-media-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

.kanews-field-media-button {
    white-space: nowrap;
}

/* Ad Type Specific Styles */
.html-code-settings,
.image-settings {
    display: none;
}

.html-code-settings.is-active,
.image-settings.is-active {
    display: block;
}

/* Reset Button Styles */
.kanews-reset-button {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    color: #72777c;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.kanews-reset-button:hover {
    opacity: 1;
    color: #dc3232;
}

.kanews-reset-button .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Reset Message Styles */
.kanews-reset-message {
    background: #fff;
    border-left: 4px solid #46b450;
    padding: 8px 12px;
    margin: 5px 0 15px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* Widget Title düzenlemesi */
.widget-title {
    position: relative;
}

/* Hover durumunda reset butonu görünürlüğü */
.widget-top:hover .kanews-reset-button {
    opacity: 0.8;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 15px;
}

/* Icon Picker Styles */
.kanews-icon-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.kanews-icon-picker-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    min-width: 120px;
}

.kanews-icon-picker-preview i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.kanews-icon-picker-name {
    font-size: 13px;
    color: #50575e;
}

.kanews-icon-picker-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000000;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.kanews-icon-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
}

.kanews-icon-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.kanews-icon-picker-search {
    padding: 8px;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.kanews-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.kanews-icon-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kanews-icon-picker-item:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.kanews-icon-picker-item.is-selected {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.kanews-icon-picker-item i {
    font-size: 24px;
    margin-bottom: 5px;
}

.kanews-icon-picker-item span {
    font-size: 10px;
    text-align: center;
    word-break: break-all;
}

/* Kapatma butonu düzeltmesi */
.kanews-icon-picker-modal .button-link {
    padding: 0;
    color: #666;
    cursor: pointer;
    border: none;
    background: none;
}

.kanews-icon-picker-modal .button-link:hover {
    color: #dc3232;
}

.kanews-icon-picker-modal .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

#widget-list [id*="kanews"] .widget-top{
  border-color: rgba(255, 0, 0, 0.5) !important;
}

#widget-list [id*="kanews"] .widget-top::after {
    content: "Diğer";
    position: absolute;
    right: 38px;
    top: 8px;
    border-radius: 4px;
    background: #000;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;

}
#widget-list [id*="manset"] .widget-top::after {
    content: "Manşet";
    position: absolute;
    right: 38px;
    top: 8px;
    border-radius: 4px;
    background: #dc3232;
    color: #fff;
    padding: 5px 10px;
    /* border-radius: 4px; */
    font-size: 12px;
    font-weight: 500;

}

#widget-list [id*="posts"] .widget-top::after, #widget-list [id*="slider"] .widget-top::after, #widget-list [id*="ticker"] .widget-top::after, #widget-list [id*="carousel"] .widget-top::after, #widget-list [id*="tab_menu"] .widget-top::after   {
    content: "Yazılar";
    position: absolute;
    right: 38px;
    top: 8px;
    border-radius: 4px;
    background: #0073aa;
    color: #fff;
    padding: 5px 10px;
    /* border-radius: 4px; */
    font-size: 12px;
    font-weight: 500;

}

 #widget-list [id*="slider"] .widget-top::after {
    content: "Slider";
    position: absolute;
    right: 38px;
    top: 8px;
    border-radius: 4px;
    background: #24c481;
    color: #fff;
    padding: 5px 10px;
    /* border-radius: 4px; */
    font-size: 12px;
    font-weight: 500;

}