/**
 * Admin styles for Enable Classic Editor Settings
 */

.classic-editor-plus-settings {
    max-width: 950px;
}

/* Mode Indicator */
.ecew-mode-indicator {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-left: 4px solid #dcdcde;
    background-color: #f6f7f7;
    border-radius: 4px;
}

.ecew-mode-indicator.advanced {
    border-left-color: #2271b1;
    background-color: #e7f3ff;
}

.ecew-mode-indicator.simple {
    border-left-color: #7cb342;
    background-color: #f0f5eb;
}

.mode-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ecew-mode-indicator.advanced .mode-badge {
    background-color: #2271b1;
    color: white;
}

.ecew-mode-indicator.simple .mode-badge {
    background-color: #7cb342;
    color: white;
}

.mode-description {
    margin: 0;
    color: #50575e;
    font-size: 13px;
    line-height: 1.5;
}

.classic-editor-plus-settings .postbox {
    margin-bottom: 20px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: none;
}

.classic-editor-plus-settings .hndle {
    border-bottom: 1px solid #dcdcde;
    padding: 12px 15px;
    background: #f6f7f7;
    font-size: 14px;
    font-weight: 600;
}

.classic-editor-plus-settings .inside {
    padding: 15px;
}

.classic-editor-plus-settings .form-table {
    margin-top: 0;
}

.classic-editor-plus-settings .form-table th {
    padding: 15px 10px 15px 0;
    width: 200px;
    font-weight: 500;
}

.classic-editor-plus-settings .form-table td {
    padding: 15px 10px;
}

.classic-editor-plus-settings .description {
    font-style: normal;
    color: #646970;
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Toggle switch styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

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

input:checked + .slider {
    background-color: #2271b1;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2271b1;
}

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

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Post type and role checkboxes */
.post-type-checkboxes,
.role-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.checkbox-item {
    flex: 0 0 calc(25% - 10px);
    min-width: 150px;
    background: #f6f7f7;
    border-radius: 4px;
    padding: 8px 12px;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

/* Submit buttons */
.submit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive styling */
@media screen and (max-width: 782px) {
    .checkbox-item {
        flex: 0 0 calc(50% - 10px);
    }
    
    .classic-editor-plus-settings .form-table th {
        width: 100%;
        padding-bottom: 0;
    }
    
    .classic-editor-plus-settings .form-table td {
        padding-top: 5px;
    }
}

@media screen and (max-width: 600px) {
    .checkbox-item {
        flex: 0 0 100%;
    }

    .submit-buttons {
        flex-direction: column;
    }

    .submit-buttons .button {
        width: 100%;
        text-align: center;
    }
}

/* Disabled setting style (for dependency management) */
.classic-editor-plus-settings .form-table tr.disabled-setting {
    opacity: 0.5;
    pointer-events: none;
}

.classic-editor-plus-settings .form-table tr.disabled-setting th,
.classic-editor-plus-settings .form-table tr.disabled-setting td {
    color: #a7aaad;
}

/* Save button states */
.classic-editor-plus-settings #submit {
    transition: all 0.3s ease;
    min-width: 120px;
}

.classic-editor-plus-settings #submit.saving {
    background: #2271b1;
    border-color: #2271b1;
    opacity: 0.8;
    cursor: wait;
}

.classic-editor-plus-settings #submit.saved {
    background: #00a32a !important;
    border-color: #00a32a !important;
    box-shadow: none !important;
}

.classic-editor-plus-settings #submit.error {
    background: #d63638;
    border-color: #d63638;
}

/* Toast notifications */
.ecew-toast {
    position: fixed;
    top: 50px;
    right: 20px;
    background: white;
    border-left: 4px solid #00a32a;
    padding: 15px 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 999999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    max-width: 350px;
}

.ecew-toast.show {
    transform: translateX(0);
}

.ecew-toast.ecew-toast-error {
    border-left-color: #d63638;
    color: #d63638;
}

.ecew-toast.ecew-toast-warning {
    border-left-color: #dba617;
    color: #dba617;
}

.ecew-toast.ecew-toast-success {
    border-left-color: #00a32a;
    color: #1d2327;
}

/* Unsaved changes indicator */
.unsaved-indicator {
    color: #dba617;
    margin-right: 10px;
    font-size: 13px;
    animation: pulse 2s infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Modal overlay and dialog */
.ecew-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999998;
    align-items: center;
    justify-content: center;
}

.ecew-modal {
    background: white;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    margin: 50px auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.ecew-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #dcdcde;
}

.ecew-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
}

.ecew-modal-body {
    padding: 20px 24px;
    color: #1d2327;
}

.ecew-modal-body p {
    margin: 12px 0;
    line-height: 1.6;
}

.ecew-modal-body ul {
    margin: 15px 0;
    padding-left: 25px;
}

.ecew-modal-body li {
    margin: 10px 0;
    line-height: 1.5;
}

.ecew-modal-footer {
    padding: 15px 24px;
    border-top: 1px solid #dcdcde;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f6f7f7;
}

.button-danger {
    background: #d63638 !important;
    border-color: #d63638 !important;
    color: white !important;
    text-shadow: none !important;
}

.button-danger:hover,
.button-danger:focus {
    background: #c92c2f !important;
    border-color: #c92c2f !important;
    color: white !important;
}

@media screen and (max-width: 600px) {
    .ecew-modal {
        width: 95%;
        margin: 20px auto;
    }

    .ecew-modal-footer {
        flex-direction: column;
    }

    .ecew-modal-footer .button {
        width: 100%;
        text-align: center;
    }
}

/* Help tooltips */
.ecew-help-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #787c82;
    margin-left: 5px;
    vertical-align: middle;
}

.ecew-help-tooltip .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.ecew-help-tooltip:hover {
    color: #2271b1;
}

.ecew-help-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    background: #1d2327;
    color: white;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 4px;
    white-space: normal;
    width: 280px;
    max-width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.ecew-help-tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1d2327;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

.ecew-help-tooltip:hover::after,
.ecew-help-tooltip:hover::before {
    opacity: 1;
}

@media screen and (max-width: 782px) {
    .ecew-help-tooltip::after {
        width: 220px;
        max-width: 220px;
    }
}
