/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #2A2B2F;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #3A3B3F;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

/* Hide Scrollbar */
#sidebar::-webkit-scrollbar,
#sidebar *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#sidebar,
#sidebar * {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Prevent scroll chaining from sidebar to main content */
#sidebar {
    overscroll-behavior: contain;
}

#sidebar > div {
    overscroll-behavior: contain;
}

/* Mobile Sidebar */
#sidebar {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 1023px) {
    #sidebar {
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }
}

/* Animated Gradient Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient-flow {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

/* Bottom Gradient for Button Visibility */
#bottom-fade {
    position: fixed;
    bottom: 0;
    left: 18rem;
    right: 0;
    height: 280px;
    background: linear-gradient(to top, #0B0C0F 0%, #0B0C0F 30%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}

/* Login Screen States */

#login-screen {
    background: linear-gradient(
        -45deg,
        #0B0C0F,
        #0f1820,
        #0a2020,
        #0f1820,
        #0B0C0F
    );
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

.logged-out aside {
    display: none;
}

.logged-out main {
    display: none;
}

/* Base Styles */
body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0B0C0F;
    background-image: 
        radial-gradient(ellipse at 0% 0%, rgba(74, 131, 248, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(92, 201, 188, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    color: white;
    min-height: 100vh;
}

/* Card Styles */
.card-container {
    background: linear-gradient(145deg, rgba(22, 24, 28, 0.8) 0%, rgba(15, 17, 20, 0.9) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.card-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-link {
    display: block;
    text-decoration: none;
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1e24 0%, #14171c 50%, #1a1e24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-favicon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    padding: 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.card-container:hover .card-favicon {
    transform: scale(1.05);
}

.card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(18, 20, 23, 1) 0%, rgba(18, 20, 23, 0) 50%);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #f3f4f6;
    margin-bottom: 6px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.card-url {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 14px;
    flex-grow: 1;
    letter-spacing: 0.01em;
}

.card-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.card-container:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-actions button {
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    color: #9ca3af;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.card-actions button:hover {
    background: rgba(74, 131, 248, 0.15);
    color: #4A83F8;
    border-color: rgba(74, 131, 248, 0.3);
    transform: scale(1.05);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto; /* Pushes tags to the bottom */
}

/* Tag Pill Styles */
.tag-pill {
    display: inline-block;
    background: linear-gradient(135deg, rgba(40, 42, 46, 0.8) 0%, rgba(32, 34, 38, 0.8) 100%);
    backdrop-filter: blur(8px);
    color: #c4c7cd;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-pill:hover {
    background: linear-gradient(135deg, #4A83F8 0%, #5CC9BC 100%);
    color: white;
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 131, 248, 0.3);
}

/* Sidebar Tag Link Styles */
.tag-link {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #b4b7be;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0 8px;
    font-weight: 500;
}

.tag-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tag-link.active {
    color: white;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(74, 131, 248, 0.15), rgba(92, 201, 188, 0.15));
    border: 1px solid rgba(74, 131, 248, 0.3);
    box-shadow: 0 4px 12px rgba(74, 131, 248, 0.2);
}

.tag-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, #4A83F8, #5CC9BC);
    border-radius: 0 6px 6px 0;
    box-shadow: 0 0 12px rgba(74, 131, 248, 0.6);
}

/* Add Link Button Animation */
#add-link-button {
    transition: all 300ms ease;
}

#add-link-button:hover {
    box-shadow: 0 0 20px rgba(74, 131, 248, 0.4), 0 0 40px rgba(92, 201, 188, 0.2);
}

/* Responsive Grid */
#cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Larger cards on bigger screens */
@media (min-width: 1536px) {
    #cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media (min-width: 1920px) {
    #cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    }
}

/* Folder drag and drop styles */
.folder-item {
    transition: border-color 0.15s ease;
}

.folder-item.opacity-50 {
    opacity: 0.5;
}

.folder-item.border-t-2 {
    border-top: 2px solid #4A83F8;
}

.folder-item[draggable="true"] > div:first-child {
    cursor: grab;
}

.folder-item[draggable="true"]:active > div:first-child {
    cursor: grabbing;
}

/* Custom Dropdown Styles */
.custom-dropdown-option {
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #E5E7EB;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-dropdown-option:hover {
    background: rgba(74, 131, 248, 0.15);
    color: #fff;
}

.custom-dropdown-option.selected {
    background: linear-gradient(135deg, #4A83F8 0%, #5CC9BC 100%);
    color: white;
    font-weight: 500;
}

.custom-dropdown-option .option-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.custom-dropdown-option:hover .option-icon,
.custom-dropdown-option.selected .option-icon {
    opacity: 1;
}

#folder-parent-chevron.rotate-180 {
    transform: rotate(180deg);
}

/* ===== SMOOTH ANIMATIONS FOR NORMAL MODE ===== */

/* Card styles with smooth hover */
.card-item {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease, 
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    cursor: grab;
    position: relative;
}

/* Card hover - lift and glow */
.card-item:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(74, 131, 248, 0.12);
    border-color: rgba(74, 131, 248, 0.3) !important;
}

.card-item:active {
    cursor: grabbing;
    transform: translateY(-3px) scale(1.01);
}

.card-item.opacity-50 {
    opacity: 0.4;
    transform: scale(0.95);
}

/* Drop zone indicator line */
.card-item.drag-over-left,
.card-item.drag-over-right {
    z-index: 10;
}

.card-item.drag-over-left::before {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: -16px;
    width: 4px;
    background: linear-gradient(180deg, #4A83F8 0%, #5CC9BC 100%);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(74, 131, 248, 0.8), 0 0 24px rgba(92, 201, 188, 0.4);
    z-index: 100;
    animation: pulse-line 1s ease-in-out infinite;
}

.card-item.drag-over-right::after {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    right: -16px;
    width: 4px;
    background: linear-gradient(180deg, #4A83F8 0%, #5CC9BC 100%);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(74, 131, 248, 0.8), 0 0 24px rgba(92, 201, 188, 0.4);
    z-index: 100;
    animation: pulse-line 1s ease-in-out infinite;
}

/* Scale up target card slightly */
.card-item.drag-over-left,
.card-item.drag-over-right {
    transform: scale(1.02);
}

@keyframes pulse-line {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(74, 131, 248, 0.8), 0 0 24px rgba(92, 201, 188, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(74, 131, 248, 1), 0 0 40px rgba(92, 201, 188, 0.6);
    }
}

/* ===== MORE SMOOTH ANIMATIONS ===== */

/* Sidebar tag/folder hover */
[data-tag-name],
.folder-item {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s ease,
                box-shadow 0.25s ease;
}

[data-tag-name]:hover {
    transform: translateX(4px);
}

/* Button hover effects */
button, a {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s ease,
                box-shadow 0.25s ease,
                border-color 0.2s ease,
                opacity 0.2s ease;
}

/* Add link button pulse */
#add-link-button {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s ease;
}

/* Dialog/modal animations */
dialog[open],
.dialog-content {
    animation: dialogFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Logo button hover */
#logo-button {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#logo-button:hover {
    transform: scale(1.05);
}

#logo-button:hover img {
    filter: brightness(1.1);
}

/* Profile picture hover */
#google-login-button img,
#user-profile-picture {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

#google-login-button:hover img,
#user-profile-picture:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(74, 131, 248, 0.3);
}

/* Search input focus animation */
#card-search-input,
#tag-search-input {
    transition: border-color 0.25s ease,
                box-shadow 0.25s ease,
                background-color 0.25s ease;
}

/* Smooth icon transitions */
i[data-lucide] {
    transition: transform 0.2s ease, 
                color 0.2s ease,
                opacity 0.2s ease;
}

/* ===== PARTY MODE - MAXIMUM PARTY! ===== */

/* Party mode active state - more intense bg */
body.party-mode {
    animation: party-bg 0.3s ease-in-out infinite;
}

@keyframes party-bg {
    0% { background-color: #0B0C0F; }
    20% { background-color: #1a0520; }
    40% { background-color: #051a20; }
    60% { background-color: #20051a; }
    80% { background-color: #0a1a05; }
    100% { background-color: #0B0C0F; }
}

/* ===== REALISTIC DISCO BALL ===== */
#disco-ball {
    box-shadow: 
        0 0 100px rgba(255, 255, 255, 0.6),
        0 0 200px rgba(255, 255, 255, 0.3),
        inset 0 -20px 40px rgba(0, 0, 0, 0.6),
        inset 0 20px 40px rgba(255, 255, 255, 0.3);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.disco-ball-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
}

/* Realistic mirror tile pattern */
.disco-tiles-realistic {
    width: 100%;
    height: 100%;
    background: 
        /* Horizontal lines */
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(0,0,0,0.4) 8px,
            rgba(0,0,0,0.4) 9px
        ),
        /* Vertical lines */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 8px,
            rgba(0,0,0,0.4) 8px,
            rgba(0,0,0,0.4) 9px
        ),
        /* Individual tile shimmer */
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.9) 0px,
            rgba(220,220,220,0.8) 4px,
            rgba(180,180,180,0.9) 8px
        );
    border-radius: 50%;
}

body.party-mode #disco-ball {
    animation: disco-spin-3d 4s linear infinite;
}

@keyframes disco-spin-3d {
    0% { transform: rotateY(0deg) rotateX(5deg); }
    100% { transform: rotateY(360deg) rotateX(5deg); }
}

body.party-mode .disco-tiles-realistic {
    animation: tile-flash 0.15s steps(4) infinite;
}

@keyframes tile-flash {
    0% { filter: brightness(1) contrast(1.2); }
    25% { filter: brightness(1.5) contrast(1.4) hue-rotate(60deg); }
    50% { filter: brightness(1.2) contrast(1.3) hue-rotate(120deg); }
    75% { filter: brightness(1.6) contrast(1.5) hue-rotate(180deg); }
    100% { filter: brightness(1) contrast(1.2) hue-rotate(240deg); }
}

/* Disco ball drop animation - bigger drop */
body.party-mode .disco-string {
    height: 120px;
}

/* ===== SPOTLIGHT BEAMS FROM DISCO BALL ===== */
.spotlight-beam {
    position: absolute;
    width: 4px;
    height: 100vh;
    top: 150px;
    left: 50%;
    opacity: 0;
    transform-origin: top center;
}

body.party-mode .spotlight-beam {
    opacity: 0.6;
}

.spotlight-beam-1 {
    background: linear-gradient(to bottom, #ff0080, transparent 70%);
    animation: beam-rotate-1 3s linear infinite;
}
.spotlight-beam-2 {
    background: linear-gradient(to bottom, #00ffff, transparent 70%);
    animation: beam-rotate-2 3s linear infinite;
}
.spotlight-beam-3 {
    background: linear-gradient(to bottom, #ffff00, transparent 70%);
    animation: beam-rotate-3 3s linear infinite;
}
.spotlight-beam-4 {
    background: linear-gradient(to bottom, #00ff00, transparent 70%);
    animation: beam-rotate-4 3s linear infinite;
}
.spotlight-beam-5 {
    background: linear-gradient(to bottom, #ff00ff, transparent 70%);
    animation: beam-rotate-5 3s linear infinite;
}
.spotlight-beam-6 {
    background: linear-gradient(to bottom, #ff8800, transparent 70%);
    animation: beam-rotate-6 3s linear infinite;
}
.spotlight-beam-7 {
    background: linear-gradient(to bottom, #00ff88, transparent 70%);
    animation: beam-rotate-7 3s linear infinite;
}
.spotlight-beam-8 {
    background: linear-gradient(to bottom, #8800ff, transparent 70%);
    animation: beam-rotate-8 3s linear infinite;
}

@keyframes beam-rotate-1 { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes beam-rotate-2 { 0% { transform: rotate(45deg); } 100% { transform: rotate(405deg); } }
@keyframes beam-rotate-3 { 0% { transform: rotate(90deg); } 100% { transform: rotate(450deg); } }
@keyframes beam-rotate-4 { 0% { transform: rotate(135deg); } 100% { transform: rotate(495deg); } }
@keyframes beam-rotate-5 { 0% { transform: rotate(180deg); } 100% { transform: rotate(540deg); } }
@keyframes beam-rotate-6 { 0% { transform: rotate(225deg); } 100% { transform: rotate(585deg); } }
@keyframes beam-rotate-7 { 0% { transform: rotate(270deg); } 100% { transform: rotate(630deg); } }
@keyframes beam-rotate-8 { 0% { transform: rotate(315deg); } 100% { transform: rotate(675deg); } }

/* ===== LASER BEAMS ===== */
.laser {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor 20%, currentColor 80%, transparent);
    opacity: 0;
    filter: blur(1px);
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

body.party-mode .laser {
    opacity: 0.8;
}

.laser-1 {
    color: #ff0000;
    top: 20%;
    left: -10%;
    width: 120%;
    animation: laser-sweep-1 2s ease-in-out infinite;
}
.laser-2 {
    color: #00ff00;
    top: 40%;
    right: -10%;
    width: 120%;
    animation: laser-sweep-2 2.3s ease-in-out infinite;
}
.laser-3 {
    color: #0088ff;
    top: 60%;
    left: -10%;
    width: 120%;
    animation: laser-sweep-3 1.8s ease-in-out infinite;
}
.laser-4 {
    color: #ff00ff;
    top: 80%;
    right: -10%;
    width: 120%;
    animation: laser-sweep-4 2.5s ease-in-out infinite;
}
.laser-5 {
    color: #ffff00;
    top: 30%;
    left: -10%;
    width: 120%;
    animation: laser-sweep-5 1.5s ease-in-out infinite;
}
.laser-6 {
    color: #00ffff;
    top: 70%;
    left: -10%;
    width: 120%;
    animation: laser-sweep-6 2.1s ease-in-out infinite;
}

@keyframes laser-sweep-1 {
    0%, 100% { transform: rotate(-15deg) translateX(-20%); opacity: 0; }
    20%, 80% { opacity: 0.8; }
    50% { transform: rotate(15deg) translateX(20%); }
}
@keyframes laser-sweep-2 {
    0%, 100% { transform: rotate(20deg) translateX(20%); opacity: 0; }
    20%, 80% { opacity: 0.8; }
    50% { transform: rotate(-20deg) translateX(-20%); }
}
@keyframes laser-sweep-3 {
    0%, 100% { transform: rotate(-10deg); opacity: 0; }
    30%, 70% { opacity: 0.9; }
    50% { transform: rotate(25deg); }
}
@keyframes laser-sweep-4 {
    0%, 100% { transform: rotate(25deg); opacity: 0; }
    25%, 75% { opacity: 0.7; }
    50% { transform: rotate(-15deg); }
}
@keyframes laser-sweep-5 {
    0%, 100% { transform: rotate(-5deg) scaleX(0.5); opacity: 0; }
    50% { transform: rotate(20deg) scaleX(1); opacity: 0.9; }
}
@keyframes laser-sweep-6 {
    0%, 100% { transform: rotate(10deg) scaleX(0.8); opacity: 0; }
    50% { transform: rotate(-10deg) scaleX(1.2); opacity: 0.8; }
}

/* ===== STROBE EFFECT ===== */
#strobe-overlay {
    opacity: 0;
}

body.party-mode #strobe-overlay {
    animation: strobe 0.1s steps(2) infinite;
}

@keyframes strobe {
    0%, 49% { opacity: 0; }
    50%, 100% { opacity: 0.05; }
}

/* ===== CONFETTI ===== */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
}

.confetti-piece::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: var(--confetti-color);
    animation: confetti-spin 1s linear infinite;
}

@keyframes confetti-fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0.5; }
}

@keyframes confetti-spin {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(180deg); }
}

/* ===== PARTY LIGHTS - MORE INTENSE ===== */
.party-light {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0;
    mix-blend-mode: screen;
}

body.party-mode .party-light {
    opacity: 0.8;
}

.party-light-1 {
    background: #ff0080;
    top: 5%;
    left: 5%;
    animation: party-light-pulse-1 0.8s ease-in-out infinite;
}

.party-light-2 {
    background: #00ffff;
    top: 10%;
    right: 5%;
    animation: party-light-pulse-2 0.9s ease-in-out infinite;
}

.party-light-3 {
    background: #ffff00;
    bottom: 40%;
    left: 15%;
    animation: party-light-pulse-3 0.7s ease-in-out infinite;
}

.party-light-4 {
    background: #00ff00;
    bottom: 30%;
    right: 15%;
    animation: party-light-pulse-4 1s ease-in-out infinite;
}

.party-light-5 {
    background: #ff00ff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: party-light-pulse-5 0.6s ease-in-out infinite;
}

.party-light-6 {
    background: #ff4400;
    bottom: 10%;
    left: 40%;
    animation: party-light-pulse-6 0.85s ease-in-out infinite;
}

@keyframes party-light-pulse-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    50% { transform: translate(150px, 80px) scale(1.5); opacity: 1; }
}

@keyframes party-light-pulse-2 {
    0%, 100% { transform: translate(0, 0) scale(1.2); opacity: 0.7; }
    50% { transform: translate(-120px, 100px) scale(1.8); opacity: 1; }
}

@keyframes party-light-pulse-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    50% { transform: translate(80px, -80px) scale(1.4); opacity: 0.6; }
}

@keyframes party-light-pulse-4 {
    0%, 100% { transform: translate(0, 0) scale(1.3); opacity: 0.6; }
    50% { transform: translate(-150px, -60px) scale(1.8); opacity: 0.9; }
}

@keyframes party-light-pulse-5 {
    0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(2); opacity: 1; }
}

@keyframes party-light-pulse-6 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(100px, 50px) scale(1.6); opacity: 0.9; }
}

/* Dancing cards - MORE INTENSE */
body.party-mode .card-item {
    animation: card-dance 0.3s ease-in-out infinite;
}

body.party-mode .card-item:nth-child(2n) {
    animation-delay: 0.05s;
    animation-name: card-dance-alt;
}

body.party-mode .card-item:nth-child(3n) {
    animation-delay: 0.1s;
    animation-name: card-dance-wild;
}

body.party-mode .card-item:nth-child(4n) {
    animation-delay: 0.07s;
}

@keyframes card-dance {
    0%, 100% { transform: rotate(-3deg) translateY(0) scale(1); }
    25% { transform: rotate(4deg) translateY(-10px) scale(1.02); }
    50% { transform: rotate(-2deg) translateY(-5px) scale(0.98); }
    75% { transform: rotate(5deg) translateY(-8px) scale(1.01); }
}

@keyframes card-dance-alt {
    0%, 100% { transform: rotate(3deg) translateY(0) scale(1); }
    25% { transform: rotate(-5deg) translateY(-12px) scale(1.03); }
    50% { transform: rotate(2deg) translateY(-6px) scale(0.97); }
    75% { transform: rotate(-4deg) translateY(-10px) scale(1.02); }
}

@keyframes card-dance-wild {
    0%, 100% { transform: rotate(0deg) translateY(0) translateX(0); }
    25% { transform: rotate(-6deg) translateY(-15px) translateX(5px); }
    50% { transform: rotate(4deg) translateY(-8px) translateX(-5px); }
    75% { transform: rotate(-3deg) translateY(-12px) translateX(3px); }
}

/* Dancing tags in sidebar - PARTY HARD */
body.party-mode [data-tag-name],
body.party-mode .folder-item {
    animation: tag-wiggle 0.25s ease-in-out infinite;
}

body.party-mode [data-tag-name]:nth-child(2n),
body.party-mode .folder-item:nth-child(2n) {
    animation-delay: 0.05s;
    animation-name: tag-bounce;
}

body.party-mode [data-tag-name]:nth-child(3n),
body.party-mode .folder-item:nth-child(3n) {
    animation-delay: 0.03s;
    animation-name: tag-shake;
}

@keyframes tag-wiggle {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    25% { transform: translateX(5px) rotate(3deg) scale(1.05); }
    75% { transform: translateX(-5px) rotate(-3deg) scale(0.95); }
}

@keyframes tag-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

@keyframes tag-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Party mode button glow when active */
body.party-mode #party-mode-button {
    background: linear-gradient(135deg, #ff0080, #7928ca, #00d4ff);
    background-size: 200% 200%;
    animation: party-button-glow 1s ease-in-out infinite;
    border-color: #ff0080;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

body.party-mode #party-mode-button i {
    color: white;
}

@keyframes party-button-glow {
    0%, 100% { background-position: 0% 50%; box-shadow: 0 0 20px rgba(255, 0, 128, 0.5); }
    50% { background-position: 100% 50%; box-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }
}

/* Sidebar rainbow border in party mode */
body.party-mode #sidebar {
    border-right: 3px solid;
    border-image: linear-gradient(180deg, #ff0080, #7928ca, #00d4ff, #00ff00, #ffff00, #ff0080) 1;
    animation: rainbow-border 2s linear infinite;
}

@keyframes rainbow-border {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Add link button bounce in party mode */
body.party-mode #add-link-button {
    animation: bounce-glow 0.6s ease-in-out infinite;
}

@keyframes bounce-glow {
    0%, 100% { 
        transform: translate(-50%, 0) scale(1); 
        box-shadow: 0 0 30px rgba(74, 131, 248, 0.5);
    }
    50% { 
        transform: translate(-50%, -10px) scale(1.05); 
        box-shadow: 0 0 50px rgba(255, 0, 128, 0.7), 0 0 80px rgba(0, 212, 255, 0.5);
    }
}

/* Logo spin in party mode */
body.party-mode #logo-button img {
    animation: logo-spin 1s linear infinite;
}

@keyframes logo-spin {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    to { transform: rotate(360deg) scale(1); }
}

/* Rainbow text effect */
body.party-mode h1,
body.party-mode h2,
body.party-mode .card-item h3 {
    animation: rainbow-text 0.5s linear infinite;
}

@keyframes rainbow-text {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Screen shake effect */
body.party-mode #main-content {
    animation: screen-shake 0.15s ease-in-out infinite;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) translateY(1px); }
    50% { transform: translateX(2px) translateY(-1px); }
    75% { transform: translateX(-1px) translateY(2px); }
}

/* Pulsing glow on everything */
body.party-mode * {
    --party-glow: 0 0 10px currentColor;
}

body.party-mode .card-item {
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.3), 0 0 60px rgba(0, 255, 255, 0.2);
}

body.party-mode .card-item:nth-child(2n) {
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.3), 0 0 60px rgba(255, 0, 255, 0.2);
}

body.party-mode .card-item:nth-child(3n) {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3), 0 0 60px rgba(0, 128, 255, 0.2);
}

/* ===== AI SEARCH STYLES ===== */

.ai-search-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}