/**
 * Elementor Proofreader - Stylesheet
 * High-end, modern and clean UI
 */

.ep-proofreader-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    border: 1px solid #1e293b;
    box-sizing: border-box;
}

.ep-proofreader-wrapper * {
    box-sizing: border-box;
}

.ep-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #1e293b;
}

.ep-title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #38bdf8;
}

.ep-title-badge .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.ep-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-lang-select {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ep-lang-select:focus {
    border-color: #38bdf8;
}

/* Buttons */
.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.ep-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ep-btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
}

.ep-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
}

.ep-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.ep-btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.ep-btn-secondary,
.ep-btn-select-all,
.ep-btn-deselect-all {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
}

.ep-btn-secondary:hover:not(:disabled),
.ep-btn-select-all:hover:not(:disabled),
.ep-btn-deselect-all:hover:not(:disabled) {
    background: #334155;
    color: #ffffff;
}

.ep-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Course Search UI */
.ep-search-container {
    position: relative;
    margin-top: 14px;
}

.ep-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.ep-search-icon {
    position: absolute;
    left: 12px;
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.ep-search-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 38px 10px 38px;
    color: #f8fafc;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.ep-search-input:focus {
    border-color: #38bdf8;
    background: #172554;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.ep-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ep-search-clear:hover {
    color: #f8fafc;
}

.ep-search-spinner {
    position: absolute;
    right: 36px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: ep-spin 0.6s linear infinite;
}

@keyframes ep-spin {
    to { transform: rotate(360deg); }
}

.ep-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

.ep-search-results {
    display: flex;
    flex-direction: column;
}

.ep-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #1e293b;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ep-search-result-item:last-child {
    border-bottom: none;
}

.ep-search-result-item:hover {
    background: #1e293b;
}

.ep-res-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ep-res-title {
    font-size: 13.5px;
    color: #f1f5f9;
}

.ep-res-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.ep-res-id {
    color: #38bdf8;
    font-weight: 600;
}

.ep-res-type {
    background: #1e293b;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #334155;
    text-transform: capitalize;
}

.ep-badge-elem {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-weight: 600;
}

.ep-search-loading,
.ep-search-empty {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.ep-spinner-sm {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: ep-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

/* Selected Course Bar */
.ep-selected-course-bar {
    margin-top: 14px;
    background: #132338;
    border: 1px solid #0284c7;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ep-selected-course-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.ep-selected-badge {
    color: #94a3b8;
    font-size: 12px;
}

.ep-selected-title {
    color: #38bdf8;
    font-size: 14px;
}

.ep-selected-id {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #e2e8f0;
    font-family: monospace;
}

.ep-selected-type {
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

/* Course & Popups Hierarchy Tree Box */
.ep-popups-overview-box {
    margin-top: 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 16px;
}

.ep-popups-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

.ep-popups-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #38bdf8;
    font-size: 13px;
}

.ep-popups-title-wrap .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ep-popups-count-badge {
    background: #1e293b;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.ep-tree-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.ep-tree-main {
    padding: 6px 10px;
    background: #1e293b;
    border-radius: 6px;
    border-left: 3px solid #38bdf8;
}

.ep-tree-badge-main {
    background: #0284c7;
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ep-popups-sublist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 20px;
    border-left: 2px dashed #334155;
    margin-left: 12px;
}

.ep-tree-popup {
    padding: 4px 8px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 6px;
    border: 1px solid #1e293b;
}

.ep-tree-badge-popup {
    background: #7c3aed;
    color: #f5f3ff;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ep-tree-id {
    color: #64748b;
    font-family: monospace;
    font-size: 12px;
}

.ep-no-popups-note {
    font-size: 12px;
    color: #64748b;
    padding: 4px 0;
}

/* Post Tag Badges in Issue Cards */
.ep-post-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ep-tag-main {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.ep-tag-popup {
    background: rgba(124, 58, 237, 0.2);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.4);
}

/* Admin Tabs Styling */
.ep-admin-wrap .nav-tab-wrapper {
    border-bottom: 1px solid #cbd5e1;
    margin-bottom: 20px;
}

.ep-admin-wrap .nav-tab {
    font-size: 14px;
    padding: 8px 16px;
    color: #475569;
}

.ep-admin-wrap .nav-tab-active {
    color: #0284c7;
    font-weight: 600;
    border-bottom-color: #f0f0f1;
}

/* Progress Panel */
.ep-progress-panel {
    margin-top: 18px;
    background: #1e293b;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #334155;
}

.ep-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ep-progress-track {
    width: 100%;
    height: 8px;
    background: #0f172a;
    border-radius: 4px;
    overflow: hidden;
}

.ep-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 0.3s ease;
}

/* Results Panel */
.ep-results-panel {
    margin-top: 20px;
}

.ep-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px;
    background: #1e293b;
    border-radius: 10px;
    border: 1px solid #334155;
    margin-bottom: 16px;
}

.ep-summary-stat {
    display: flex;
    flex-direction: column;
}

.ep-stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #38bdf8;
    line-height: 1.1;
}

.ep-stat-label {
    font-size: 12px;
    color: #94a3b8;
}

.ep-summary-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Issues List */
.ep-issues-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.ep-issue-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: border-color 0.2s, background-color 0.2s;
}

.ep-issue-card:hover {
    border-color: #475569;
}

.ep-issue-card.ep-selected {
    border-color: #38bdf8;
    background: #1a2744;
}

.ep-issue-checkbox-wrapper {
    padding-top: 2px;
}

.ep-issue-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #38bdf8;
}

.ep-issue-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-issue-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ep-widget-tag {
    font-size: 11px;
    background: #0f172a;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #334155;
}

.ep-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.ep-badge-spelling {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.ep-badge-accent {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.ep-badge-grammar {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.ep-badge-punctuation {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.ep-badge-capitalization {
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.4);
}

/* Diff View */
.ep-diff-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #0f172a;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    font-size: 13px;
    line-height: 1.5;
}

.ep-diff-original {
    color: #fca5a5;
    text-decoration: line-through;
}

.ep-diff-corrected {
    color: #86efac;
    font-weight: 500;
}

.ep-issue-reason {
    font-size: 12px;
    color: #cbd5e1;
    font-style: italic;
}

/* Toast Message */
.ep-toast {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.ep-toast-success {
    background: #064e3b;
    color: #6ee7b7;
    border: 1px solid #059669;
}

.ep-toast-error {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.ep-no-issues-msg {
    text-align: center;
    padding: 30px 20px;
    color: #34d399;
    font-size: 15px;
    font-weight: 500;
    background: #1e293b;
    border-radius: 10px;
    border: 1px dashed #059669;
}
