/* ==========================================================================
   swaplol.com - Universal Aesthetic Design System & Bugfix Stylesheet
   ========================================================================== */

:root {
    --bg-main: #050508;
    --bg-surface: #0a0a0f;
    --bg-surface-elevated: #111118;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-glow: rgba(255, 255, 255, 0.04);
    --sidebar-width: 260px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Image & SVG Constraints (Fixes Giant Purple Logo & Overflow Glitches)
   -------------------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
}

.brand-logo, .nav-logo {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.brand-logo-lg {
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   Glassmorphism Cards & Panels
   -------------------------------------------------------------------------- */
.glass-card, .glass-panel {
    background: #0b0b10 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: var(--border-hover) !important;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------------------
   Inputs, Controls & Buttons
   -------------------------------------------------------------------------- */
.form-input, .custom-select {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
}

.form-input:focus, .custom-select:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12) !important;
}

.btn-primary {
    background: #ffffff !important;
    color: #000000 !important;
    font-weight: 600;
    border-radius: 12px;
    padding: 10px 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary:hover {
    background: #e4e4e7 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.22);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 12px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Dashboard & App Layout Structure
   -------------------------------------------------------------------------- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.dashboard-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    background: #08080c;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 40;
    overflow-y: auto;
}

.dashboard-content {
    flex: 1;
    min-width: 0;
    padding: 32px 40px;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .dashboard-content {
        padding: 20px 16px;
    }
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 4px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-item.active {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.sidebar-item.active svg {
    color: #000000 !important;
}

/* --------------------------------------------------------------------------
   Profiles Editor Tabs & Grid Layout
   -------------------------------------------------------------------------- */
.editor-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
}

.editor-form-col {
    flex: 1 1 580px;
    min-width: 320px;
}

.editor-preview-col {
    flex: 0 0 460px;
    min-width: 320px;
    position: sticky;
    top: 84px;
    height: fit-content;
}

@media (max-width: 1024px) {
    .editor-preview-col {
        position: static;
        flex: 1 1 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: #000000 !important;
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.tab-btn.active svg {
    color: #000000 !important;
}

/* --------------------------------------------------------------------------
   Live Bio-Card & Badges Styling
   -------------------------------------------------------------------------- */
.badge-svg-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.badge-svg-container:hover {
    transform: scale(1.18);
    z-index: 20;
}

.badge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 50;
}

.badge-svg-container:hover .badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   Profile Banner Header
   -------------------------------------------------------------------------- */
.profile-banner-wrap {
    width: 100%;
    height: 120px;
    position: relative;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.4) 100%);
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.profile-avatar-over-banner {
    position: relative;
    z-index: 5;
}

/* --------------------------------------------------------------------------
   3D Tilt Card Container
   -------------------------------------------------------------------------- */
.perspective-container {
    perspective: 1200px;
}

.card-tilt-3d {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* --------------------------------------------------------------------------
   Atmospheric Visual Overlays (CRT, VHS, Matrix, Vignette)
   -------------------------------------------------------------------------- */
.overlay-crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.04));
    z-index: 2;
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
}

.overlay-vhs::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.15), rgba(0,0,0,0.15) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 2;
    animation: vhsFlicker 0.15s infinite;
}

@keyframes vhsFlicker {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

.overlay-vignette::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 45%, rgba(0, 0, 0, 0.85) 100%);
    pointer-events: none;
    z-index: 2;
}

/* --------------------------------------------------------------------------
   Audio Visualizer Equalizer Waves
   -------------------------------------------------------------------------- */
.audio-visualizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 18px;
}

.eq-bar {
    width: 3px;
    background: #ffffff;
    border-radius: 2px;
    height: 4px;
    animation: eqDance 0.8s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) { animation-duration: 0.6s; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { animation-duration: 0.9s; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { animation-duration: 0.7s; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-duration: 1.1s; animation-delay: 0.4s; }
.eq-bar:nth-child(5) { animation-duration: 0.8s; animation-delay: 0.15s; }

@keyframes eqDance {
    0% { height: 3px; opacity: 0.4; }
    100% { height: 18px; opacity: 1; }
}

.audio-paused .eq-bar {
    animation-play-state: paused;
    height: 3px !important;
    opacity: 0.3;
}

/* --------------------------------------------------------------------------
   Text Animations (Rainbow, Glitch, Glow, Sparkle)
   -------------------------------------------------------------------------- */
.effect-rainbow {
    background: linear-gradient(90deg, #f43f5e, #eab308, #10b981, #38bdf8, #a855f7, #f43f5e);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowShift 4s linear infinite;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.effect-glitch {
    position: relative;
    display: inline-block;
    color: #ffffff;
    animation: glitchText 2.5s infinite;
}

@keyframes glitchText {
    0% { transform: translate(0); }
    2% { transform: translate(-2px, 1px); }
    4% { transform: translate(2px, -1px); }
    6% { transform: translate(0); }
    100% { transform: translate(0); }
}

.effect-sparkle {
    background: linear-gradient(135deg, #fef08a 0%, #ffffff 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.6));
}

/* --------------------------------------------------------------------------
   Custom Upload File Button & Dropzone
   -------------------------------------------------------------------------- */
.file-upload-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.file-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   Scrollbar & Smooth Animations
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #050508;
}

::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: translateY(12px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-fade-scale {
    animation: fadeInScale 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --------------------------------------------------------------------------
   Avatar Decorations & Animated Frames
   -------------------------------------------------------------------------- */
.avatar-decor-slot-container,
.avatar-decor-layer {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    pointer-events: none;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-decor-slot-container > .avatar-decor-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.decor-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

@keyframes spinSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes orbitShark {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes crownFloat {
    0% { transform: translate(80px, 26px); }
    100% { transform: translate(80px, 20px); filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.7)); }
}

@keyframes glintSparkle {
    0%, 100% { opacity: 0.2; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(1.3) rotate(45deg); }
}

@keyframes eyeBlink {
    0%, 45%, 55%, 100% { transform: translate(80px, 134px) scaleY(1); }
    50% { transform: translate(80px, 134px) scaleY(0.1); }
}

@keyframes pupilShift {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-3px); }
    70% { transform: translateX(3px); }
}

@keyframes flameBurn {
    0% { transform: scale(0.97) translateY(1px); filter: drop-shadow(0 0 6px rgba(234, 88, 12, 0.5)); }
    100% { transform: scale(1.03) translateY(-2px); filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.9)); }
}

@keyframes sparkRise {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

@keyframes dropFall {
    0% { transform: translateY(0); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(35px); opacity: 0; }
}

@keyframes lightningFlash {
    0%, 100% { opacity: 0; }
    15% { opacity: 1; filter: drop-shadow(0 0 8px #38bdf8); }
    20% { opacity: 0; }
    40% { opacity: 0.9; filter: drop-shadow(0 0 12px #93c5fd); }
    45% { opacity: 0; }
}

@keyframes skullHover {
    0% { transform: translate(80px, 25px); }
    100% { transform: translate(80px, 20px); filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6)); }
}

.anim-spin-slow {
    transform-origin: 80px 80px;
    animation: spinSlow 12s linear infinite;
}

.anim-spin-reverse {
    transform-origin: 80px 80px;
    animation: spinReverse 10s linear infinite;
}

.anim-orbit-shark {
    transform-origin: 80px 80px;
    animation: orbitShark 5s linear infinite;
}

.anim-orbit-sakura {
    transform-origin: 80px 80px;
    animation: orbitShark 6s linear infinite;
}

.anim-orbit-sakura-2 {
    transform-origin: 80px 80px;
    animation: orbitShark 8s linear infinite reverse;
}

.anim-orbit-planet {
    transform-origin: 80px 80px;
    animation: orbitShark 7s linear infinite;
}

.anim-crown-float {
    animation: crownFloat 2.6s ease-in-out infinite alternate;
}

.anim-glint {
    animation: glintSparkle 1.8s ease-in-out infinite;
}

.anim-eye-blink {
    animation: eyeBlink 4.5s ease-in-out infinite;
}

.anim-pupil-shift {
    animation: pupilShift 3s ease-in-out infinite;
}

.anim-flame-burn {
    transform-origin: 80px 135px;
    animation: flameBurn 1.2s ease-in-out infinite alternate;
}

.anim-spark-rise {
    animation: sparkRise 1.8s ease-out infinite;
}

.anim-spark-rise-delayed {
    animation: sparkRise 2.2s ease-out 0.8s infinite;
}

.anim-drop-fall {
    animation: dropFall 2s ease-in infinite;
}

.anim-drop-fall-delayed {
    animation: dropFall 2.4s ease-in 1s infinite;
}

.anim-lightning-flash {
    animation: lightningFlash 2s infinite;
}

.anim-lightning-flash-delayed {
    animation: lightningFlash 2.5s 0.6s infinite;
}

.anim-lightning-flash-fast {
    animation: lightningFlash 1.7s 1.1s infinite;
}

.anim-skull-hover {
    animation: skullHover 2.4s ease-in-out infinite alternate;
}

.anim-pulse-fast {
    animation: pulseFast 1.5s ease-in-out infinite alternate;
}

@keyframes pulseFast {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* --------------------------------------------------------------------------
   Atmospheric Theme Overlays (Horror Blood Rain, Shark Abyss)
   -------------------------------------------------------------------------- */
.overlay-horror::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(153, 27, 27, 0.15) 0%, rgba(20, 0, 0, 0.85) 100%), repeating-linear-gradient(0deg, rgba(0,0,0,0.2), rgba(0,0,0,0.2) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 2;
    animation: horrorPulse 4s ease-in-out infinite alternate;
}

@keyframes horrorPulse {
    0% { opacity: 0.7; }
    100% { opacity: 0.95; }
}

.overlay-abyss::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.12) 0%, rgba(2, 6, 23, 0.85) 100%), linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 2;
}
