/* ============================================================
   PROFILE EDITOR - Modern Dark Glassmorphism Design V2
   Split View Layout with Sticky Preview & Locked Items System
   ============================================================ */

/* ==================== ROOT VARIABLES ==================== */
:root {
    --pe-bg-primary: #0a0a0f;
    --pe-bg-secondary: #121218;
    --pe-bg-card: rgba(20, 20, 30, 0.85);
    --pe-bg-glass: rgba(255, 255, 255, 0.03);
    --pe-border-subtle: rgba(255, 255, 255, 0.08);
    --pe-border-glow: rgba(139, 92, 246, 0.5);
    --pe-accent: #8b5cf6;
    --pe-accent-hover: #a78bfa;
    --pe-accent-glow: rgba(139, 92, 246, 0.4);
    --pe-gold: #fbbf24;
    --pe-gold-glow: rgba(251, 191, 36, 0.5);
    --pe-text-primary: #f4f4f5;
    --pe-text-secondary: #a1a1aa;
    --pe-text-muted: #71717a;
    --pe-success: #22c55e;
    --pe-danger: #ef4444;
    --pe-warning: #f59e0b;
}

/* ==================== MODAL OVERLAY ==================== */
#profile-editor-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: peModalFadeIn 0.3s ease-out;
}

#profile-editor-modal.active {
    display: flex;
}

@keyframes peModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== MAIN CONTAINER ==================== */
.pe-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    max-height: 750px;
    background: var(--pe-bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--pe-border-subtle);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 100px var(--pe-accent-glow);
    animation: peSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes peSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== LEFT PANEL - PREVIEW (STICKY) ==================== */
.pe-preview-panel {
    width: 340px;
    min-width: 340px;
    background: linear-gradient(180deg, var(--pe-bg-primary) 0%, #0d0d14 100%);
    border-right: 1px solid var(--pe-border-subtle);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100%;
}

.pe-preview-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--pe-border-subtle);
}

.pe-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--pe-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pe-preview-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--pe-accent);
    border-radius: 50%;
    animation: pePulse 2s infinite;
}

@keyframes pePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ==================== PROFILE CARD PREVIEW ==================== */
.pe-card-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pe-profile-card {
    width: 100%;
    max-width: 280px;
    background: var(--pe-bg-card);
    border-radius: 20px;
    border: 1px solid var(--pe-border-subtle);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pe-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--pe-accent-glow);
}

.pe-card-banner {
    height: 90px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.pe-card-avatar-wrapper {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.pe-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--pe-bg-card);
    background: linear-gradient(135deg, var(--pe-accent) 0%, #6366f1 100%);
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.pe-card-avatar.square {
    border-radius: 16px;
}

.pe-card-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--pe-success);
    border-radius: 50%;
    border: 3px solid var(--pe-bg-card);
}

.pe-card-content {
    padding: 50px 20px 20px;
    text-align: center;
}

.pe-card-nick {
    font-size: 20px;
    font-weight: 700;
    color: var(--pe-text-primary);
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.pe-card-bio {
    font-size: 13px;
    color: var(--pe-text-secondary);
    line-height: 1.5;
    margin-top: 12px;
    min-height: 40px;
}

.pe-card-socials {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pe-border-subtle);
}

.pe-card-social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pe-bg-glass);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pe-card-social-icon:hover {
    background: var(--pe-accent);
    transform: translateY(-2px);
}

/* ==================== RIGHT PANEL - EDITOR (SCROLLABLE) ==================== */
.pe-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--pe-bg-secondary);
}

.pe-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--pe-border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.pe-editor-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--pe-text-primary);
    margin: 0;
}

.pe-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    border-radius: 12px;
    color: var(--pe-text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pe-close-btn:hover {
    background: var(--pe-danger);
    border-color: var(--pe-danger);
    color: white;
    transform: rotate(90deg);
}

/* ==================== SCROLLABLE CONTENT ==================== */
.pe-editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    scroll-behavior: smooth;
}

.pe-editor-content::-webkit-scrollbar {
    width: 6px;
}

.pe-editor-content::-webkit-scrollbar-track {
    background: transparent;
}

.pe-editor-content::-webkit-scrollbar-thumb {
    background: var(--pe-border-subtle);
    border-radius: 3px;
}

.pe-editor-content::-webkit-scrollbar-thumb:hover {
    background: var(--pe-accent);
}

/* ==================== SECTIONS ==================== */
.pe-section {
    margin-bottom: 32px;
}

.pe-section:last-child {
    margin-bottom: 0;
}

.pe-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pe-border-subtle);
}

.pe-section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pe-accent) 0%, #6366f1 100%);
    border-radius: 10px;
    font-size: 18px;
}

.pe-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--pe-text-primary);
    margin: 0;
}

.pe-section-subtitle {
    font-size: 12px;
    color: var(--pe-text-muted);
    margin-top: 2px;
}

/* ==================== COLOR PICKER - BALLS STYLE ==================== */
.pe-color-group {
    margin-bottom: 16px;
}

.pe-color-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--pe-text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pe-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pe-color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pe-color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.pe-color-btn.active {
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--pe-accent), 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Premium colors with golden glow */
.pe-color-btn.is-premium {
    box-shadow: 0 0 10px var(--pe-gold-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pe-color-btn.is-premium::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--pe-gold);
    border-radius: 50%;
    animation: peGoldenPulse 2s infinite;
}

@keyframes peGoldenPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ==================== LOCKED ITEMS SYSTEM ==================== */
.pe-color-btn.is-locked,
.pe-font-btn.is-locked,
.pe-effect-btn.is-locked {
    opacity: 0.5;
    cursor: pointer;
    position: relative;
}

.pe-color-btn.is-locked::before {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
    z-index: 2;
}

.pe-color-btn.is-locked:hover {
    transform: scale(1.08);
    opacity: 0.65;
}

/* Locked fonts/effects show lock in corner */
.pe-font-btn.is-locked::after,
.pe-effect-btn.is-locked .pe-effect-lock {
    content: '🔒';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
}

.pe-font-btn.is-locked:hover,
.pe-effect-btn.is-locked:hover {
    opacity: 0.65;
    transform: translateY(-1px);
}

/* Premium items with golden border */
.pe-color-btn.is-premium.is-locked,
.pe-font-btn.is-premium.is-locked,
.pe-effect-btn.is-premium.is-locked {
    border-color: var(--pe-gold) !important;
}

/* Custom color picker */
.pe-custom-color {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: var(--pe-bg-glass);
    border-radius: 12px;
    border: 1px solid var(--pe-border-subtle);
}

.pe-custom-color input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

.pe-custom-color input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.pe-custom-color input[type="color"]::-webkit-color-swatch {
    border-radius: 8px;
    border: 2px solid var(--pe-border-subtle);
}

.pe-custom-color-label {
    font-size: 13px;
    color: var(--pe-text-secondary);
}

/* ==================== FONT PICKER ==================== */
.pe-font-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pe-font-btn {
    padding: 12px 16px;
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    border-radius: 12px;
    color: var(--pe-text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pe-font-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--pe-accent);
}

.pe-font-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-color: var(--pe-accent);
    box-shadow: 0 0 15px var(--pe-accent-glow);
}

/* ==================== EFFECT PICKER ==================== */
.pe-effect-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.pe-effect-btn {
    padding: 14px 8px;
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.pe-effect-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--pe-accent);
    transform: translateY(-2px);
}

.pe-effect-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: var(--pe-accent);
    box-shadow: 0 4px 20px var(--pe-accent-glow);
}

.pe-effect-icon {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
}

.pe-effect-name {
    font-size: 11px;
    color: var(--pe-text-secondary);
    font-weight: 500;
}

/* Effect tiers */
.pe-effect-btn.tier-1 { border-left: 3px solid #60a5fa; }
.pe-effect-btn.tier-2 { border-left: 3px solid #a78bfa; }
.pe-effect-btn.tier-3 { border-left: 3px solid #f472b6; }
.pe-effect-btn.tier-4 { border-left: 3px solid #fbbf24; }
.pe-effect-btn.tier-5 {
    border-left: 3px solid transparent;
    background: linear-gradient(var(--pe-bg-glass), var(--pe-bg-glass)) padding-box,
                linear-gradient(135deg, #fbbf24, #f472b6, #8b5cf6) border-box;
}

/* ==================== UPLOAD BUTTONS ==================== */
.pe-upload-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.pe-upload-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--pe-bg-glass);
    border: 2px dashed var(--pe-border-subtle);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pe-upload-btn:hover {
    border-color: var(--pe-accent);
    background: rgba(139, 92, 246, 0.05);
}

.pe-upload-btn.has-file {
    border-style: solid;
    border-color: var(--pe-success);
    background: rgba(34, 197, 94, 0.05);
}

.pe-upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.pe-upload-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pe-text-primary);
}

.pe-upload-hint {
    font-size: 11px;
    color: var(--pe-text-muted);
    margin-top: 4px;
}

.pe-upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pe-danger);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pe-upload-btn:hover .pe-upload-remove {
    opacity: 1;
}

/* ==================== TEXT INPUT & TEXTAREA ==================== */
.pe-input-group {
    margin-bottom: 16px;
}

.pe-input-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--pe-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pe-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    border-radius: 12px;
    color: var(--pe-text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pe-input:focus {
    outline: none;
    border-color: var(--pe-accent);
    box-shadow: 0 0 0 3px var(--pe-accent-glow);
}

.pe-input::placeholder {
    color: var(--pe-text-muted);
}

.pe-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.pe-char-count {
    text-align: right;
    font-size: 11px;
    color: var(--pe-text-muted);
    margin-top: 6px;
}

/* ==================== SOCIAL LINKS ==================== */
.pe-social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pe-social-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.pe-social-input-wrapper:focus-within {
    border-color: var(--pe-accent);
    box-shadow: 0 0 0 3px var(--pe-accent-glow);
}

.pe-social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--pe-border-subtle);
}

.pe-social-input {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--pe-text-primary);
    font-size: 13px;
}

.pe-social-input:focus {
    outline: none;
}

.pe-social-input::placeholder {
    color: var(--pe-text-muted);
}

/* ==================== SHAPE TOGGLE ==================== */
.pe-shape-toggle {
    display: flex;
    background: var(--pe-bg-glass);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--pe-border-subtle);
}

.pe-shape-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--pe-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pe-shape-btn:hover {
    color: var(--pe-text-primary);
}

.pe-shape-btn.active {
    background: var(--pe-accent);
    color: white;
    box-shadow: 0 2px 10px var(--pe-accent-glow);
}

/* ==================== FOOTER ACTIONS ==================== */
.pe-editor-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--pe-border-subtle);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.pe-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.pe-btn-secondary {
    background: var(--pe-bg-glass);
    border: 1px solid var(--pe-border-subtle);
    color: var(--pe-text-secondary);
}

.pe-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--pe-text-primary);
}

.pe-btn-primary {
    background: linear-gradient(135deg, var(--pe-accent) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px var(--pe-accent-glow);
}

.pe-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--pe-accent-glow);
}

.pe-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== LOCKED ITEM TOAST ==================== */
.pe-locked-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #1f1f2e 0%, #16161f 100%);
    border: 1px solid var(--pe-gold);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--pe-gold-glow);
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pe-locked-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pe-locked-toast-icon {
    font-size: 32px;
}

.pe-locked-toast-content {
    flex: 1;
}

.pe-locked-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pe-text-primary);
    margin-bottom: 4px;
}

.pe-locked-toast-desc {
    font-size: 12px;
    color: var(--pe-text-secondary);
}

.pe-locked-toast-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--pe-gold) 0%, #f59e0b 100%);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pe-locked-toast-btn:hover {
    transform: scale(1.05);
}

/* ==================== NICK EFFECTS PREVIEW ==================== */
.pe-card-nick.effect-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.pe-card-nick.effect-shadow {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.pe-card-nick.effect-neon {
    text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
    animation: peNeonFlicker 1.5s infinite alternate;
}

@keyframes peNeonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.pe-card-nick.effect-gradient {
    background: linear-gradient(90deg, #ff0080, #00ffff, #ff0080);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: peGradientMove 3s linear infinite;
}

@keyframes peGradientMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.pe-card-nick.effect-pulse {
    animation: pePulseEffect 1.5s ease-in-out infinite;
}

@keyframes pePulseEffect {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.pe-card-nick.effect-rainbow {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: peRainbow 4s linear infinite;
}

@keyframes peRainbow {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; }
}

.pe-card-nick.effect-fire {
    text-shadow: 0 0 10px #ff4500, 0 0 20px #ff6600, 0 0 30px #ff9900;
    animation: peFire 0.5s ease-in-out infinite alternate;
}

@keyframes peFire {
    0% { text-shadow: 0 0 10px #ff4500, 0 0 20px #ff6600, 0 -5px 30px #ff9900; }
    100% { text-shadow: 0 0 15px #ff6600, 0 0 25px #ff4500, 0 -10px 35px #ffcc00; }
}

.pe-card-nick.effect-ice {
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00bfff, 0 0 30px #1e90ff;
    animation: peIce 2s ease-in-out infinite;
}

@keyframes peIce {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.pe-card-nick.effect-electric {
    text-shadow: 0 0 5px #ffff00, 0 0 15px #ffff00;
    animation: peElectric 0.1s ease-in-out infinite;
}

@keyframes peElectric {
    0%, 100% { opacity: 1; transform: translateX(0); }
    25% { opacity: 0.9; transform: translateX(-1px); }
    75% { opacity: 0.95; transform: translateX(1px); }
}

.pe-card-nick.effect-glitch {
    animation: peGlitch 0.5s infinite;
}

@keyframes peGlitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.pe-card-nick.effect-plasma {
    background: linear-gradient(90deg, #9400d3, #ff00ff, #00ffff, #9400d3);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pePlasma 2s linear infinite;
    filter: drop-shadow(0 0 10px rgba(148, 0, 211, 0.5));
}

@keyframes pePlasma {
    0% { background-position: 0% center; }
    100% { background-position: 300% center; }
}

.pe-card-nick.effect-cosmic {
    background: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 25%, #2d1b4e 50%, #1a1a3e 75%, #0c0c1d 100%);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: peCosmic 8s ease infinite;
    text-shadow: 0 0 30px rgba(138, 43, 226, 0.8);
}

@keyframes peCosmic {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.pe-card-nick.effect-legendary {
    background: linear-gradient(90deg, #ffd700, #ffec8b, #fff8dc, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: peLegendary 2s linear infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

@keyframes peLegendary {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .pe-container {
        flex-direction: column;
        height: 95vh;
        max-height: none;
    }

    .pe-preview-panel {
        width: 100%;
        min-width: auto;
        height: auto;
        min-height: 280px;
        border-right: none;
        border-bottom: 1px solid var(--pe-border-subtle);
    }

    .pe-card-wrapper {
        padding: 16px;
    }

    .pe-profile-card {
        max-width: 240px;
    }

    .pe-editor-content {
        padding: 20px;
    }

    .pe-effect-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pe-font-grid {
        grid-template-columns: 1fr;
    }

    .pe-social-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pe-container {
        border-radius: 16px;
    }

    .pe-effect-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pe-upload-row {
        flex-direction: column;
    }

    .pe-editor-footer {
        flex-direction: column;
    }

    .pe-btn {
        width: 100%;
    }
}

/* ==================== DRAG & DROP STATES ==================== */
.pe-upload-btn.dragover {
    border-color: var(--pe-accent);
    background: rgba(139, 92, 246, 0.15);
    transform: scale(1.02);
}

/* ==================== LOADING STATES ==================== */
.pe-btn-primary.loading {
    position: relative;
    color: transparent;
}

.pe-btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: peSpinner 0.8s linear infinite;
}

@keyframes peSpinner {
    to { transform: rotate(360deg); }
}

/* ==================== HIDE OLD MODAL ==================== */
#profile-custom-modal.profile-modal-overlay {
    display: none !important;
}

/* ==================== ENSURE NEW MODAL IS ON TOP ==================== */
#profile-editor-modal {
    isolation: isolate;
}
