/* Outfit font loaded locally from assets/fonts/fonts.css — no external Google Fonts (GDPR). */

:root {
    --ps-primary: #FF6600;
    --ps-primary-hover: #e65c00;
    --ps-accent: #FECC01;
    --ps-accent-soft: rgba(254, 204, 1, 0.15);
    --ps-bg: #f8fafc;
    --ps-card-bg: #ffffff;
    --ps-text: #1e293b;
    --ps-text-dim: #64748b;
    --ps-border: #e2e8f0;
    --ps-success: #10b981;
    --ps-warning: #f59e0b;
    --ps-error: #ef4444;
    --ps-radius: 12px;
    --ps-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ps-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ps-theme-dark {
    --ps-bg: #0f172a;
    --ps-card-bg: #1e293b;
    --ps-text: #f1f5f9;
    --ps-text-dim: #94a3b8;
    --ps-border: #334155;
    --ps-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

.parcelselector-admin-wrap {
    font-family: var(--ps-font);
    max-width: 1200px;
    margin: 20px auto;
    color: var(--ps-text);
}

/* ──────────────── HEADER ──────────────── */
.parcelselector-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ps-card-bg);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: var(--ps-shadow);
    position: relative;
    overflow: hidden;
}

/* Glassmorphism subtle background for header */
.parcelselector-admin-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: linear-gradient(135deg, rgba(254, 204, 1, 0.1) 0%, rgba(255, 102, 0, 0.05) 100%);
    transform: rotate(25deg);
    z-index: 0;
}

.parcelselector-header-left { position: relative; z-index: 1; }
.parcelselector-header-right { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }

.parcelselector-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    color: var(--ps-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.parcelselector-version {
    font-size: 12px;
    background: var(--ps-primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    margin-left: 4px;
}

.parcelselector-subtitle {
    margin: 4px 0 0 0;
    color: var(--ps-text-dim);
    font-size: 15px;
    font-weight: 400;
}

/* ──────────────── BADGES ──────────────── */
.parcelselector-license-badge {
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.parcelselector-license-active {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--ps-success);
    color: var(--ps-success);
}

.parcelselector-license-inactive {
    background: var(--ps-accent-soft);
    border: 1px solid var(--ps-accent);
    color: #856404;
}

.ps-theme-dark .parcelselector-license-inactive {
    color: var(--ps-accent);
}

.parcelselector-counter {
    background: rgba(0,0,0,0.05);
    padding: 2px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
}

.ps-theme-dark .parcelselector-counter { background: rgba(255,255,255,0.05); }

/* ──────────────── TABS ──────────────── */
.parcelselector-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px;
    margin-bottom: -1px;
    border: none !important;
}

.parcelselector-tabs .nav-tab {
    font-family: var(--ps-font);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--ps-border);
    border-bottom: none;
    background: var(--ps-bg);
    color: var(--ps-text-dim);
    margin: 0 !important;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.parcelselector-tabs .nav-tab:hover {
    background: var(--ps-card-bg);
    color: var(--ps-primary);
}

.parcelselector-tabs .nav-tab-active {
    background: var(--ps-card-bg) !important;
    color: var(--ps-primary) !important;
    border-color: var(--ps-border) !important;
    border-bottom: 2px solid var(--ps-card-bg) !important;
    margin-bottom: -1px !important;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
}

/* ──────────────── CONTENT ──────────────── */
.parcelselector-tab-content {
    background: var(--ps-card-bg);
    border: 1px solid var(--ps-border);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--ps-shadow);
    min-height: 500px;
    animation: psFadeIn 0.3s ease-out;
}

@keyframes psFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ──────────────── CARDS ──────────────── */
.parcelselector-card {
    background: var(--ps-bg);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 30px;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.parcelselector-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.parcelselector-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ps-text);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.parcelselector-section h2::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--ps-accent) 0%, transparent 100%);
    opacity: 0.3;
}

.parcelselector-section p.description {
    color: var(--ps-text-dim);
    font-size: 15px;
    margin-bottom: 24px;
}

/* ──────────────── INPUTS ──────────────── */
select, input[type="text"], input[type="number"], input[type="email"], textarea {
    font-family: var(--ps-font) !important;
    border-radius: 8px !important;
    border: 1px solid var(--ps-border) !important;
    padding: 8px 12px !important;
    background: var(--ps-card-bg) !important;
    color: var(--ps-text) !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--ps-primary) !important;
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.1) !important;
    outline: none !important;
}

.parcelselector-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
    font-family: var(--ps-font) !important;
    transition: all 0.2s !important;
}

.parcelselector-btn-primary {
    background: var(--ps-primary) !important;
    color: #fff !important;
    border: none !important;
}

.parcelselector-btn-primary:hover {
    background: var(--ps-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.2);
}

.parcelselector-btn-secondary {
    background: transparent !important;
    color: var(--ps-primary) !important;
    border: 2px solid var(--ps-primary) !important;
}

.parcelselector-btn-secondary:hover {
    background: rgba(255, 102, 0, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.1);
}

/* ──────────────── OVERLAY ──────────────── */
.ps-saving-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999; visibility: hidden; opacity: 0; transition: all 0.3s;
}

.ps-theme-dark .ps-saving-overlay { background: rgba(15, 23, 42, 0.4); }
.ps-saving-active .ps-saving-overlay { visibility: visible; opacity: 1; }

.ps-save-spinner {
    width: 60px; height: 60px; border: 5px solid rgba(255, 102, 0, 0.1); border-top: 5px solid var(--ps-primary);
    border-radius: 50%; animation: ps-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes ps-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ──────────────── FOOTER ──────────────── */
.parcelselector-admin-footer {
    text-align: center;
    padding: 30px;
    color: var(--ps-text-dim);
    font-size: 14px;
    border-top: 1px solid var(--ps-border);
    margin-top: 40px;
}

.parcelselector-admin-footer a {
    color: var(--ps-primary);
    font-weight: 600;
    text-decoration: none;
}

.parcelselector-admin-footer a:hover { text-decoration: underline; }

/* ──────────────── BEHAVIOR TAB SPECIALS ──────────────── */
.ps-zoom-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 10px;
}
.ps-zoom-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}
.ps-zoom-mode-card:hover {
    border-color: var(--ps-accent);
    background: var(--ps-accent-soft);
}
.ps-zoom-active {
    border-color: var(--ps-primary) !important;
    background: rgba(255, 102, 0, 0.05) !important;
    box-shadow: 0 4px 12px rgba(255,102,0,0.1);
}
.ps-zoom-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.ps-zoom-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ps-text);
    margin-bottom: 4px;
}
.ps-zoom-desc {
    font-size: 13px;
    color: var(--ps-text-dim);
    line-height: 1.5;
}
.ps-zoom-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--ps-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ──────────────── MAPS TAB SPECIALS ──────────────── */
.ps-engine-toggle {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.ps-engine-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 280px;
    padding: 24px;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-card-bg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}
.ps-engine-card:hover {
    border-color: var(--ps-accent);
    background: var(--ps-accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
.ps-engine-active {
    border-color: var(--ps-primary) !important;
    background: rgba(255, 102, 0, 0.05) !important;
    box-shadow: 0 12px 30px rgba(255,102,0,0.1) !important;
}
.ps-engine-logo {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.ps-engine-card:hover .ps-engine-logo {
    transform: scale(1.1);
}
.ps-engine-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--ps-text);
    letter-spacing: 1px;
}
.ps-engine-desc {
    font-size: 13px;
    color: var(--ps-text-dim);
    margin-top: 4px;
    line-height: 1.4;
}
.ps-engine-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ps-engine-badge-active {
    background: var(--ps-primary);
    color: #fff;
}
.ps-engine-badge-inactive {
    background: var(--ps-border);
    color: var(--ps-text-dim);
}
.ps-play-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ps-play-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.parcelselector-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.parcelselector-country-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-card-bg);
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}
.parcelselector-country-card:hover {
    border-color: var(--ps-accent);
    background: var(--ps-accent-soft);
}
.parcelselector-country-card.ps-active {
    border-color: var(--ps-primary);
    background: rgba(255, 102, 0, 0.03);
}
.ps-drag-handle {
    margin-right: 12px;
    color: var(--ps-text-dim);
    font-size: 20px;
    opacity: 0.5;
    cursor: grab;
}
.ps-country-img {
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.parcelselector-country-card:hover .ps-country-img {
    transform: scale(1.1);
}

/* ──────────────── ACTIVATOR TAB SPECIALS ──────────────── */
.ps-license-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ps-license-badge-pro {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}
.ps-license-badge-free {
    background: var(--ps-border);
    color: var(--ps-text-dim);
}
.ps-license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 10px;
}
.ps-license-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-license-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ps-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ps-license-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--ps-text);
}
code.ps-code {
    background: var(--ps-border);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ps-primary);
}

/* ──────────────── TESTING TAB SPECIALS ──────────────── */
.parcelselector-status-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #10B981;
    font-weight: 700;
}
.parcelselector-status-fail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #EF4444;
    font-weight: 700;
}
.parcelselector-status-warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #F59E0B;
    font-weight: 700;
}

.ps-console-block {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.ps-console-item {
    margin-bottom: 24px;
}
.ps-console-item:last-child {
    margin-bottom: 0;
}
.ps-console-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.ps-console-engine-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ps-console-code {
    display: block;
    background: #1e293b;
    color: #86efac;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--ps-primary);
    cursor: text;
    user-select: all;
    line-height: 1.5;
}

.ps-test-map-card {
    margin-top: 30px;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    border-radius: 16px;
    padding: 32px;
    color: #fff;
    box-shadow: 0 20px 40px rgba(79,70,229,0.2);
}
.ps-test-map-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.ps-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
}
.ps-test-btn-classic {
    background: #10B981;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.ps-test-btn-anunaki {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}
.ps-test-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

/* ──────────────── PREMIUM NOTICES ──────────────── */
.parcelselector-notice {
    padding: 16px 24px;
    margin: 20px 0;
    border-radius: 12px;
    border-left: 5px solid #ccc;
    background: var(--ps-card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: psFadeIn 0.3s ease-out;
}

.parcelselector-notice-success {
    border-left-color: #10B981;
    background: rgba(16, 185, 129, 0.05);
    color: #065F46;
}
.parcelselector-notice-warning {
    border-left-color: #F59E0B;
    background: rgba(245, 158, 11, 0.05);
    color: #92400E;
}
.parcelselector-notice-error {
    border-left-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
    color: #991B1B;
}
.parcelselector-notice-info {
    border-left-color: #3B82F6;
    background: rgba(59, 130, 246, 0.05);
    color: #1E40AF;
}

.ps-theme-dark .parcelselector-notice { color: #fff; }

@keyframes psFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ──────────────── RESPONSIVE DESIGN ──────────────── */
@media (max-width: 960px) {
    .parcelselector-admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }
    
    .parcelselector-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .parcelselector-title {
        font-size: 24px;
    }
}

@media (max-width: 782px) {
    .parcelselector-admin-wrap {
        margin: 10px;
    }
    
    .parcelselector-tabs {
        flex-wrap: wrap;
        padding: 0;
    }
    
    .parcelselector-tabs .nav-tab {
        flex: 1 1 calc(50% - 8px);
        border-radius: 8px;
        border-bottom: 1px solid var(--ps-border);
        margin-bottom: 8px !important;
        justify-content: center;
    }
    
    .parcelselector-tab-content {
        padding: 20px;
        border-radius: 12px;
        margin-top: 10px;
    }
    
    .parcelselector-card {
        padding: 20px;
    }
    
    .ps-engine-toggle {
        flex-direction: column;
    }
    
    .ps-test-map-buttons {
        flex-direction: column;
    }
    
    .ps-test-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .parcelselector-header-right {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .parcelselector-tabs .nav-tab {
        flex: 1 1 100%;
    }
    
    .ps-license-grid {
        grid-template-columns: 1fr;
    }
}
