/* Bulbasoft Tuning Admin Styles */

.bsfttune-settings-container {
    max-width: 1200px;
    margin: 20px 0;
}

.bsfttune-header {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bsfttune-header h1 {
    margin: 0 0 10px 0;
    color: #23282d;
}

.bsfttune-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.bsfttune-blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.bsfttune-settings-block {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bsfttune-settings-block:hover {
    border-color: #0073aa;
    box-shadow: 0 3px 10px rgba(0,115,170,0.2);
    transform: translateY(-2px);
}

.bsfttune-settings-block.active {
    border-color: #0073aa;
    background: #f8fafb;
}

.bsfttune-block-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.bsfttune-block-icon.wordpress {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23464646"><path d="M21.469 6.825c.84 1.537 1.318 3.3 1.318 5.175 0 3.979-2.156 7.456-5.363 9.325l3.295-9.527c.615-1.54.82-2.771.82-3.864 0-.405-.026-.78-.07-1.11m-7.981.105c.647-.03 1.232-.105 1.232-.105.582-.075.514-.93-.067-.899 0 0-1.755.135-2.88.135-1.064 0-2.85-.135-2.85-.135-.582-.03-.661.854-.082.899 0 0 .537.075 1.104.105l1.644 4.5L9.281 18.675l-2.688-8.181c.647-.03 1.231-.105 1.231-.105.583-.075.514-.93-.066-.899 0 0-1.755.135-2.88.135-.203 0-.44-.006-.69-.015C6.216 6.92 8.915 5.5 12.008 5.5c2.319 0 4.43.901 6.006 2.375-.038-.002-.076-.008-.117-.013-.582-.075-.661.854-.082.899 0 0 .537.075 1.104.105l1.645 4.5-1.298 4.394L16.687 10.93M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2M12 21.5c-5.238 0-9.5-4.262-9.5-9.5S6.762 2.5 12 2.5s9.5 4.262 9.5 9.5-4.262 9.5-9.5 9.5z"/></svg>');
}

.bsfttune-block-icon.woocommerce {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23a16696"><path d="M23.7 4.2C23.2 3.5 22.5 3 21.6 3H2.4C1.5 3 0.8 3.5 0.3 4.2C-0.1 4.9-0.1 5.8 0.4 6.5L12 21L23.6 6.5C24.1 5.8 24.1 4.9 23.7 4.2ZM8 8C8.6 8 9 8.4 9 9V13C9 13.6 8.6 14 8 14C7.4 14 7 13.6 7 13V9C7 8.4 7.4 8 8 8ZM12 8C12.6 8 13 8.4 13 9V13C13 13.6 12.6 14 12 14C11.4 14 11 13.6 11 13V9C11 8.4 11.4 8 12 8ZM16 8C16.6 8 17 8.4 17 9V13C17 13.6 16.6 14 16 14C15.4 14 15 13.6 15 13V9C15 8.4 15.4 8 16 8Z"/></svg>');
}

.bsfttune-block-title {
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 10px 0;
}

.bsfttune-block-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.bsfttune-settings-content {
    display: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bsfttune-settings-content.active {
    display: block;
}

.bsfttune-back-button {
    display: inline-flex;
    align-items: center;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 15px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.bsfttune-back-button:hover {
    background: #e6e6e6;
    text-decoration: none;
    color: #333;
}

.bsfttune-back-button::before {
    content: "←";
    margin-right: 8px;
    font-weight: bold;
}

.bsfttune-setting-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.bsfttune-setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bsfttune-setting-group h3 {
    margin: 0 0 15px 0;
    color: #23282d;
    font-size: 16px;
}

.bsfttune-setting-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.bsfttune-setting-row:last-child {
    margin-bottom: 0;
}

.bsfttune-setting-label {
    flex: 0 0 200px;
    font-weight: 600;
    color: #23282d;
    padding-top: 5px;
}

.bsfttune-setting-input {
    flex: 1;
}

.bsfttune-setting-input input,
.bsfttune-setting-input select,
.bsfttune-setting-input textarea {
    width: 100%;
    max-width: 400px;
}

.bsfttune-setting-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Sorting options styling */
.bsfttune-setting-input label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    font-weight: normal;
    cursor: pointer;
    position: relative;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.bsfttune-setting-input label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
    width: auto;
    max-width: none;
}

.bsfttune-setting-input label:hover {
    color: #0073aa;
    background: #f8f9fa;
}

/* Highlight custom sorting options */
.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"] {
    background: #e8f4fd;
    border: 2px solid #0073aa;
    position: relative;
    padding-top: 20px;
}

.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"]:before {
    content: "КАСТОМНАЯ";
    position: absolute;
    top: 5px;
    right: 10px;
    background: #0073aa;
    color: white;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"]:hover {
    background: #d0e7f8;
    border-color: #005a87;
}

.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"]:hover:before {
    background: #005a87;
}

/* Enhanced styling for custom sorting descriptions */
.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"] + .bsfttune-setting-description {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    margin-top: 8px;
}

.bsfttune-setting-input label[for*="bsfttune_sorting_bsfttune"] + .bsfttune-setting-description small {
    display: block;
    margin-top: 5px;
    line-height: 1.4;
}

.bsfttune-setting-description code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

/* Settings form styling */
.bsfttune-settings-content form {
    max-width: none;
}

.bsfttune-settings-content .button-primary {
    background: #0073aa;
    border-color: #0073aa;
    padding: 8px 20px;
    font-size: 14px;
}

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

/* Status messages */
.bsfttune-settings-content .notice {
    margin: 20px 0;
    padding: 15px;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
}

.bsfttune-settings-content .notice.notice-success {
    border-left-color: #46b450;
}

.bsfttune-settings-content .notice.notice-error {
    border-left-color: #dc3232;
}

/* Image height settings */
.bsfttune-image-height-settings {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    animation: fadeIn 0.3s ease;
}

.bsfttune-image-height-settings .bsfttune-setting-row {
    align-items: center;
}

.bsfttune-image-height-settings input[type="number"] {
    width: 80px;
    margin: 0 8px 0 0;
    text-align: center;
    font-weight: 600;
}

.bsfttune-image-height-settings label {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    margin-bottom: 15px !important;
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
}

.bsfttune-image-height-settings label strong {
    min-width: 200px;
    color: #0073aa;
}

.bsfttune-image-height-settings label span {
    color: #666;
    font-size: 14px;
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .bsfttune-blocks-container {
        grid-template-columns: 1fr;
    }
    
    .bsfttune-setting-row {
        flex-direction: column;
    }
    
    .bsfttune-setting-label {
        flex: none;
        margin-bottom: 5px;
    }
    
    .bsfttune-setting-input label {
        margin-bottom: 20px;
    }
    
    .bsfttune-image-height-settings label {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .bsfttune-image-height-settings label strong {
        min-width: auto;
    }
    
    .bsfttune-image-height-settings input[type="number"] {
        margin: 5px 0;
    }
}
