/**
 * Voxfor Multilanguage - Admin Styles
 */

/* General Admin Styles */
.voxfor-ml-admin-wrap {
    max-width: 1200px;
    margin: 20px 20px 20px 0;
}

.voxfor-ml-admin-wrap h1 {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 20px;
    padding: 0;
}

/* Settings Page */
.voxfor-ml-settings-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.voxfor-ml-settings-main {
    flex: 1;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.voxfor-ml-settings-sidebar {
    width: 300px;
}

.voxfor-ml-settings-section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.voxfor-ml-settings-section:last-child {
    border-bottom: none;
}

.voxfor-ml-settings-section h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
}

.voxfor-ml-settings-section h3 {
    margin: 20px 0 10px;
    font-size: 14px;
    font-weight: 600;
}

/* Form Elements */
.voxfor-ml-form-table {
    width: 100%;
}

.voxfor-ml-form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    text-align: left;
    vertical-align: top;
    font-weight: 600;
}

.voxfor-ml-form-table td {
    padding: 20px 0;
}

.voxfor-ml-form-table input[type="text"],
.voxfor-ml-form-table input[type="password"],
.voxfor-ml-form-table input[type="number"],
.voxfor-ml-form-table select,
.voxfor-ml-form-table textarea {
    width: 100%;
    max-width: 400px;
}

.voxfor-ml-form-table textarea {
    min-height: 100px;
}

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

/* Language Selector */
.voxfor-ml-language-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-width: 600px;
}

.voxfor-ml-language-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voxfor-ml-language-option:hover {
    border-color: #0073aa;
    background-color: #f5f5f5;
}

.voxfor-ml-language-option input[type="checkbox"] {
    margin-right: 8px;
}

.voxfor-ml-language-option.selected {
    background-color: #e6f3ff;
    border-color: #0073aa;
}

/* Translation Memory Table */
.voxfor-ml-translation-table {
    width: 100%;
    border-collapse: collapse;
}

.voxfor-ml-translation-table th,
.voxfor-ml-translation-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.voxfor-ml-translation-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.voxfor-ml-translation-table tr:hover {
    background-color: #f9f9f9;
}

.voxfor-ml-translation-table .source-text,
.voxfor-ml-translation-table .translated-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voxfor-ml-translation-table .actions {
    white-space: nowrap;
}

.voxfor-ml-translation-table .actions button {
    margin-right: 5px;
}

/* Status Indicators */
.voxfor-ml-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.voxfor-ml-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.voxfor-ml-status.processing {
    background-color: #cfe2ff;
    color: #084298;
}

.voxfor-ml-status.completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.voxfor-ml-status.failed {
    background-color: #f8d7da;
    color: #842029;
}

/* Glossary and Exclusions */
.voxfor-ml-rule-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.voxfor-ml-rule-item.inactive {
    opacity: 0.6;
}

.voxfor-ml-rule-content {
    flex: 1;
}

.voxfor-ml-rule-type {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 10px;
    background: #0073aa;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.voxfor-ml-rule-value {
    font-family: monospace;
    background: #fff;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.voxfor-ml-rule-actions {
    display: flex;
    gap: 5px;
}

/* Tools Page */
.voxfor-ml-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.voxfor-ml-tool-box {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    border-radius: 4px;
}

.voxfor-ml-tool-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.voxfor-ml-tool-box p {
    margin: 0 0 15px;
    color: #666;
}

/* Meta Box */
.voxfor-ml-meta-box-content {
    padding: 10px 0;
}

.voxfor-ml-translation-status-list {
    margin: 10px 0;
}

.voxfor-ml-translation-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.voxfor-ml-translation-status-item:last-child {
    border-bottom: none;
}

.voxfor-ml-lang-flag {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 5px;
}

.voxfor-ml-lang-flag.has-translation {
    background: #d1e7dd;
    color: #0f5132;
}

.voxfor-ml-lang-flag.no-translation {
    background: #f8d7da;
    color: #842029;
}

/* Notices and Messages */
.voxfor-ml-notice {
    padding: 12px;
    margin: 10px 0;
    border-left: 4px solid;
    background: #fff;
}

.voxfor-ml-notice.info {
    border-color: #0073aa;
    background-color: #e6f3ff;
}

.voxfor-ml-notice.success {
    border-color: #46b450;
    background-color: #ecf7ed;
}

.voxfor-ml-notice.warning {
    border-color: #ffb900;
    background-color: #fff8e5;
}

.voxfor-ml-notice.error {
    border-color: #dc3232;
    background-color: #fbeaea;
}

/* Loading States */
.voxfor-ml-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.voxfor-ml-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: voxfor-ml-spin 1s linear infinite;
}

@keyframes voxfor-ml-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 782px) {
    .voxfor-ml-settings-container {
        flex-direction: column;
    }
    
    .voxfor-ml-settings-sidebar {
        width: 100%;
    }
    
    .voxfor-ml-form-table th,
    .voxfor-ml-form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .voxfor-ml-form-table th {
        padding-bottom: 5px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .voxfor-ml-admin-wrap .voxfor-ml-settings-main,
    .voxfor-ml-admin-wrap .voxfor-ml-tool-box {
        background: #fff;
        border-color: #444;
        color: #000;
    }
    
    .voxfor-ml-admin-wrap .voxfor-ml-settings-section {
        border-color: #444;
    }
    
    .voxfor-ml-admin-wrap input[type="text"],
    .voxfor-ml-admin-wrap input[type="password"],
    .voxfor-ml-admin-wrap select,
    .voxfor-ml-admin-wrap textarea {
        background: #ffffff;
        border-color: #444;
        color: #000000;
    }
}

/* Charts and Analytics */
.voxfor-ml-chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.voxfor-ml-distribution-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

.voxfor-ml-distribution-table {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.voxfor-ml-mini-progress {
    position: relative;
    background: #f0f0f0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.voxfor-ml-mini-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0073aa;
    transition: width 0.3s ease;
}

.voxfor-ml-mini-progress span {
    position: relative;
    display: block;
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

/* Cost Grid */
.voxfor-ml-costs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.voxfor-ml-cost-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.voxfor-ml-cost-box h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #666;
}

.voxfor-ml-cost-number {
    font-size: 28px;
    font-weight: 600;
    color: #0073aa;
}

.voxfor-ml-cost-text {
    font-size: 16px;
    color: #333;
}

/* Status Badges Enhanced */
.voxfor-ml-status.running {
    background: #e6f3ff;
    color: #0073aa;
}

.voxfor-ml-status.paused {
    background: #fff3cd;
    color: #856404;
}

.voxfor-ml-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* System Status */
.voxfor-ml-system-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.voxfor-ml-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.voxfor-ml-status-label {
    font-weight: 600;
    color: #333;
}

.voxfor-ml-status-value {
    color: #666;
}

.voxfor-ml-status-value.success {
    color: #46b450;
    font-weight: 600;
}

.voxfor-ml-status-value.error {
    color: #dc3232;
    font-weight: 600;
}

/* Enhanced Responsive */
@media (max-width: 768px) {
    .voxfor-ml-distribution-grid {
        grid-template-columns: 1fr;
    }
    
    .voxfor-ml-costs-grid {
        grid-template-columns: 1fr;
    }
    
    .voxfor-ml-system-status {
        grid-template-columns: 1fr;
    }
}

/* API Management Usage Statistics */
.voxfor-ml-usage-stats .usage-bar {
    margin-bottom: 15px;
}

.voxfor-ml-usage-stats .usage-bar label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.voxfor-ml-usage-stats .progress-bar {
    background-color: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 5px;
}

.voxfor-ml-usage-stats .progress {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #ffc107 80%, #dc3545 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.voxfor-ml-usage-stats .usage-bar span {
    font-size: 12px;
    color: #666;
}

/* Visual Editor Styles */
.voxfor-ml-editor-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 999999;
    min-width: 500px;
    max-width: 90vw;
    border-radius: 4px;
}

.voxfor-ml-editor-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px 4px 0 0;
}

.voxfor-ml-editor-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.voxfor-ml-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voxfor-ml-close:hover {
    color: #000;
}

.voxfor-ml-editor-body {
    padding: 20px;
}

.voxfor-ml-field {
    margin-bottom: 20px;
}

.voxfor-ml-field:last-child {
    margin-bottom: 0;
}

.voxfor-ml-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.voxfor-ml-element-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.voxfor-ml-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voxfor-ml-type-title {
    background: #e3f2fd;
    color: #1976d2;
}

.voxfor-ml-type-short_description,
.voxfor-ml-type-description {
    background: #f3e5f5;
    color: #7b1fa2;
}

.voxfor-ml-type-button {
    background: #e8f5e8;
    color: #2e7d32;
}

.voxfor-ml-type-category,
.voxfor-ml-type-tag {
    background: #fff3e0;
    color: #f57c00;
}

.voxfor-ml-type-attribute {
    background: #fce4ec;
    color: #c2185b;
}

.voxfor-ml-type-tab_title {
    background: #e0f2f1;
    color: #00695c;
}

.voxfor-ml-type-database {
    background: #f5f5f5;
    color: #616161;
}

.voxfor-ml-original {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
}

.voxfor-ml-translation {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

.voxfor-ml-meta {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.voxfor-ml-meta > div {
    flex: 1;
}

.voxfor-ml-lock-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.voxfor-ml-lock-btn:hover {
    background: #eee;
}

.voxfor-ml-editor-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 4px 4px;
}

.voxfor-ml-translatable {
    outline: 2px dashed #007cba;
    outline-offset: 2px;
    cursor: pointer;
    position: relative;
}

.voxfor-ml-translatable:hover {
    outline-color: #005a87;
    background-color: rgba(0, 124, 186, 0.1);
}

/* Segments Panel */
#voxfor-ml-segments-panel {
    position: fixed;
    top: 50px;
    right: 20px;
    width: 300px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999998;
    max-height: 70vh;
    overflow: hidden;
}

#voxfor-ml-segments-panel .panel-header {
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#voxfor-ml-segments-panel .panel-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

#voxfor-ml-segments-panel .close-panel {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
}

#voxfor-ml-segments-panel .close-panel:hover {
    color: #000;
}

#voxfor-ml-segments-panel .segments-list {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
    padding: 10px;
}

.voxfor-ml-virtual-segment {
    display: block;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.voxfor-ml-virtual-segment:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateX(2px);
}

.voxfor-ml-virtual-segment:last-child {
    margin-bottom: 0;
}

/* Type-specific styling for virtual segments */
.voxfor-ml-virtual-segment.voxfor-ml-type-category {
    border-left: 4px solid #f57c00;
}

.voxfor-ml-virtual-segment.voxfor-ml-type-tag {
    border-left: 4px solid #ff9800;
}

.voxfor-ml-virtual-segment.voxfor-ml-type-attribute {
    border-left: 4px solid #c2185b;
}

.voxfor-ml-virtual-segment.voxfor-ml-type-button {
    border-left: 4px solid #2e7d32;
}

.voxfor-ml-virtual-segment.voxfor-ml-type-tab_title {
    border-left: 4px solid #00695c;
}

.voxfor-ml-virtual-segment.voxfor-ml-type-database {
    border-left: 4px solid #616161;
}

/* Enhanced translatable element styling */
.voxfor-ml-translatable.voxfor-ml-type-title {
    outline-color: #1976d2;
}

.voxfor-ml-translatable.voxfor-ml-type-short_description,
.voxfor-ml-translatable.voxfor-ml-type-description {
    outline-color: #7b1fa2;
}

.voxfor-ml-translatable.voxfor-ml-type-button {
    outline-color: #2e7d32;
}

.voxfor-ml-translatable.voxfor-ml-type-category,
.voxfor-ml-translatable.voxfor-ml-type-tag {
    outline-color: #f57c00;
}

.voxfor-ml-translatable.voxfor-ml-type-attribute {
    outline-color: #c2185b;
}

.voxfor-ml-translatable.voxfor-ml-type-tab_title {
    outline-color: #00695c;
}
.voxfor-ml-save-settings {
    position: relative;
    left: 18px;
}