/**
 * MisterTranslate - Admin CSS
 * With WooCommerce support
 */

.mstrt-wrap { max-width: 900px; }

/* Zero balance alert */
.mstrt-zero-balance-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mstrt-zero-balance-alert .dashicons {
    color: #856404;
    font-size: 24px;
    width: 24px;
    height: 24px;
}
.mstrt-zero-balance-text {
    color: #856404;
}
.mstrt-zero-balance-text strong {
    display: block;
    margin-bottom: 3px;
}
.mstrt-zero-balance-text a {
    color: #533f03;
    font-weight: 500;
}

/* Balance bar */
.mstrt-balance-bar {
    background: linear-gradient(135deg, #ff8a4c 0%, #ff6b2b 100%);
    color: white;
    padding: 20px 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mstrt-balance-info { line-height: 1.6; }
.mstrt-balance-label { font-size: 14px; opacity: 0.9; }
.mstrt-balance-range { font-size: 18px; display: block; }
.mstrt-balance-bar .button {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}
.mstrt-balance-bar .button:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Main panel */
.mstrt-main-panel {
    background: #fff;
    padding: 25px;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
}

/* Tabs */
.mstrt-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0;
}
.mstrt-tab {
    background: #f0f0f1;
    border: 1px solid #ccd0d4;
    border-bottom: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-bottom: -2px;
}
.mstrt-tab:hover {
    background: #e5e5e5;
}
.mstrt-tab.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    color: #ff6b2b;
}
.mstrt-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Tab content */
.mstrt-tab-content {
    display: none;
}
.mstrt-tab-content.active {
    display: block;
}

/* Form sections */
.mstrt-form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.mstrt-form-section:last-child { border-bottom: none; }
.mstrt-form-section h2 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #23282d;
}

/* Search */
.mstrt-search-box {
    position: relative;
    margin-bottom: 15px;
}
.mstrt-search-box input {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border-radius: 6px;
}
.mstrt-search-box .spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Item list */
.mstrt-item-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 15px;
}
.mstrt-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mstrt-item:hover { background: #f9f9f9; }
.mstrt-item:last-child { border-bottom: none; }
.mstrt-item-checkbox { flex-shrink: 0; }
.mstrt-item-checkbox input { margin: 0; cursor: pointer; }
.mstrt-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mstrt-item-type span,
.mstrt-item-badge span {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}
.mstrt-item-sku {
    color: #666;
}

/* Builder badges */
.mstrt-builder-badge {
    color: white;
}
.mstrt-builder-elementor {
    background: #92003B;
}
.mstrt-builder-avia {
    background: #4054B2;
}
.mstrt-builder-standard {
    background: #0073aa;
}

/* Product badges */
.mstrt-product-badge {
    color: white;
}
.mstrt-product-simple {
    background: #7f54b3;
}
.mstrt-product-variable {
    background: #00a32a;
}
.mstrt-product-grouped {
    background: #2271b1;
}
.mstrt-product-external {
    background: #d63638;
}

/* Category/Tag badges */
.mstrt-cat-badge {
    background: #e5e5e5;
    color: #50575e;
}
.mstrt-tag-badge {
    background: #f0f0f1;
    color: #50575e;
}
.mstrt-attr-badge {
    background: #ddd;
    color: #23282d;
}

.mstrt-hint {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
    margin: 0;
}

/* Selection summary */
.mstrt-selection-summary {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f0f6fc;
    border-radius: 6px;
}

/* Select */
.mstrt-select {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 14px;
    border-radius: 6px;
}

/* Multilingual section */
.mstrt-multilingual-section {
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 6px;
    margin: -1px;
    padding: 20px !important;
}

/* Translate button */
.mstrt-translate-section { text-align: center; padding-top: 10px; }
#mstrt-translate-btn {
    font-size: 16px;
    padding: 15px 40px;
    border-radius: 6px;
    background: #ff8a4c !important;
    border-color: #e67a3c !important;
    color: #fff !important;
}
#mstrt-translate-btn:hover {
    background: #e67a3c !important;
}
#mstrt-translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc !important;
    border-color: #bbb !important;
}
#mstrt-translate-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Modal */
.mstrt-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
}
.mstrt-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}
.mstrt-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

/* Progress */
.mstrt-progress-content { text-align: center; padding: 40px; }
.mstrt-progress-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ff8a4c;
}
.mstrt-spin { animation: mstrt-spin 2s linear infinite; }
@keyframes mstrt-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.mstrt-progress-bar {
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin: 25px 0;
}
.mstrt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8a4c, #ff6b2b);
    width: 0%;
    transition: width 0.1s;
}
#mstrt-progress-status { color: #666; font-size: 14px; }

/* Result */
.mstrt-result-hero {
    background: linear-gradient(135deg, #ff8a4c 0%, #ff6b2b 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}
.mstrt-result-hero h3 { margin: 0 0 5px; font-size: 20px; }
.mstrt-result-hero p { margin: 0; opacity: 0.9; }
.mstrt-result-stats {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}
.mstrt-result-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #ff8a4c;
    display: block;
}
.mstrt-result-stat-label { font-size: 12px; color: #666; }
.mstrt-result-balance {
    background: #e8f5e9;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #2e7d32;
}
.mstrt-result-list {
    max-height: 200px;
    overflow-y: auto;
}
.mstrt-result-item {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 13px;
}
.mstrt-result-ok {
    background: #f0f8f0;
    border-left: 3px solid #4caf50;
}
.mstrt-result-fail {
    background: #fef0f0;
    border-left: 3px solid #dc3232;
}
.mstrt-result-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}
.mstrt-result-ok .dashicons { color: #4caf50; }
.mstrt-result-fail .dashicons { color: #dc3232; }
.mstrt-result-item a {
    color: #0073aa;
    text-decoration: none;
}
.mstrt-result-item small { color: #888; }

/* Review request */
.mstrt-review-request {
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #5d4e37;
    line-height: 1.5;
}
.mstrt-review-request .dashicons {
    color: #ffb900;
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.mstrt-review-request a {
    color: #d35400;
    font-weight: 600;
    text-decoration: none;
}
.mstrt-review-request a:hover {
    text-decoration: underline;
}

/* Settings page styles */
.mstrt-settings-wrap { max-width: 700px; }

.mstrt-no-account-alert {
    background: linear-gradient(135deg, #e7f3ff 0%, #d4e9ff 100%);
    border: 1px solid #72aee6;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mstrt-no-account-alert .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}
.mstrt-no-account-alert a {
    color: #135e96;
    font-weight: 600;
}

/* Instructions Sections */
.mstrt-instructions-section {
    margin: 15px 0;
    transition: background-color 0.5s ease;
}
.mstrt-instructions-section.mstrt-highlight {
    background-color: #fff3cd;
    padding: 12px;
    margin: 15px -12px;
    border-radius: 6px;
}
.mstrt-instructions-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
    color: #23282d;
    margin-bottom: 10px;
}
.mstrt-instructions-section h2 .dashicons {
    color: #ff8a4c;
}
.mstrt-instructions-box {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 15px;
}
.mstrt-steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: steps;
}
.mstrt-steps-list li {
    position: relative;
    padding: 8px 0 8px 40px;
    border-bottom: 1px solid #e2e4e7;
    counter-increment: steps;
    line-height: 1.4;
}
.mstrt-steps-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.mstrt-steps-list li:first-child {
    padding-top: 0;
}
.mstrt-steps-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 8px;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #ff8a4c 0%, #ff6b2b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}
.mstrt-steps-list li:first-child::before {
    top: 0;
}
.mstrt-steps-list li strong {
    display: block;
    margin-bottom: 2px;
    color: #23282d;
}
.mstrt-steps-list li a {
    color: #ff6b2b;
    text-decoration: none;
    font-weight: 500;
}
.mstrt-steps-list li a:hover {
    text-decoration: underline;
}
.mstrt-instructions-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: 4px;
    color: #856404;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
}
.mstrt-instructions-note .dashicons {
    flex-shrink: 0;
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.mstrt-instructions-cta {
    margin-top: 12px;
    text-align: center;
}
.mstrt-instructions-cta .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
}
.mstrt-instructions-cta .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .mstrt-balance-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .mstrt-item {
        flex-wrap: wrap;
    }
    .mstrt-zero-balance-alert,
    .mstrt-no-account-alert {
        flex-direction: column;
        text-align: center;
    }
    .mstrt-tabs {
        flex-wrap: wrap;
    }
    .mstrt-tab {
        flex: 1 1 auto;
        justify-content: center;
    }
    .mstrt-steps-list li {
        padding-left: 36px;
    }
}

/* ============================================
   NEW v4.2 STYLES
   ============================================ */

/* Quick translate notice */
.mstrt-quick-translate-notice {
    background: #e7f3ff;
    border: 1px solid #72aee6;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #2271b1;
}
.mstrt-quick-translate-notice .dashicons {
    margin-right: 8px;
}
.mstrt-quick-translate-notice small {
    opacity: 0.7;
    margin-left: 5px;
}

/* Cost Estimation */
.mstrt-cost-estimate {
    background: linear-gradient(135deg, #f0f6fc 0%, #e7f3ff 100%);
    border: 1px solid #72aee6;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.mstrt-estimate-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2271b1;
}
.mstrt-estimate-text {
    font-size: 14px;
    color: #1d2327;
}
.mstrt-estimate-text strong {
    font-size: 16px;
    color: #2271b1;
}
.mstrt-estimate-text small {
    display: block;
    color: #666;
    margin-top: 2px;
}

/* Language Select Dropdown */
.mstrt-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    margin-top: 10px;
    cursor: pointer;
}
.mstrt-select:focus {
    border-color: #ff8a4c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 138, 76, 0.2);
}

/* Dual Translate Buttons */
.mstrt-translate-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
#mstrt-translate-draft-btn {
    background: #f0f0f1 !important;
    border-color: #c3c4c7 !important;
    color: #50575e !important;
}
#mstrt-translate-draft-btn:hover {
    background: #e0e0e0 !important;
}
#mstrt-translate-draft-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Source Language Display */
.mstrt-source-lang {
    background: #e0e0e0;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 10px;
}

/* Preview Modal */
.mstrt-preview-content {
    max-width: 600px;
}
.mstrt-preview-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.mstrt-preview-item:last-child {
    border-bottom: none;
}
.mstrt-preview-item strong {
    display: inline-block;
    width: 120px;
    color: #666;
}
.mstrt-preview-text {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}

/* Progress Modal - Language indicator */
.mstrt-progress-lang {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b2b;
    margin-top: 10px;
}

/* Glossary */
.mstrt-glossary-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}
.mstrt-glossary-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}
.mstrt-glossary-section h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
}
.mstrt-glossary-section .description {
    margin: 0 0 15px 0;
    font-size: 12px;
}
.mstrt-glossary-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.mstrt-glossary-input input {
    flex: 1;
}
.mstrt-specific-input {
    flex-wrap: wrap;
}
.mstrt-specific-input input {
    min-width: 0;
    width: calc(50% - 5px);
    flex: none;
}
.mstrt-specific-input input:first-child {
    width: 100%;
    margin-bottom: 0;
}
.mstrt-specific-input .button {
    flex-shrink: 0;
}
.mstrt-glossary-list {
    max-height: 200px;
    overflow-y: auto;
}
.mstrt-glossary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}
.mstrt-glossary-term {
    font-weight: 600;
    color: #1d2327;
}
.mstrt-glossary-arrow {
    color: #999;
}
.mstrt-glossary-translation {
    color: #2271b1;
}
.mstrt-glossary-remove {
    margin-left: auto;
    color: #dc3232 !important;
}
.mstrt-glossary-remove:hover {
    color: #a00 !important;
}

/* Outdated Translations */
.mstrt-outdated-list {
    margin-top: 15px;
}
.mstrt-outdated-count {
    font-weight: 600;
    margin-bottom: 10px;
}
.mstrt-outdated-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff8e5;
    border: 1px solid #ffcc00;
    border-left: 4px solid #ffcc00;
    border-radius: 4px;
    margin-bottom: 8px;
}
.mstrt-outdated-info {
    flex: 1;
}
.mstrt-outdated-info small {
    color: #666;
}
.mstrt-all-good {
    color: #2e7d32 !important;
    font-style: normal !important;
}
.mstrt-all-good .dashicons {
    color: #4caf50;
    vertical-align: middle;
    margin-right: 5px;
}

/* Notification settings */
.mstrt-notification-settings {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 20px;
}
.mstrt-notification-settings h3 {
    margin-top: 0;
}
.mstrt-notification-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.mstrt-notification-row label {
    min-width: 150px;
}

@media screen and (max-width: 782px) {
    .mstrt-glossary-sections {
        grid-template-columns: 1fr;
    }
    .mstrt-translate-section {
        flex-direction: column;
    }
    .mstrt-translate-section .button-hero {
        width: 100%;
    }
}
