:root {
    --bg-dark: #07090e;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    --accent-cyan: #22d3ee;
    --accent-violet: #818cf8;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --font-primary: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Stunning Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-cyan);
    top: -200px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-violet);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Glass Header & Search */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 9, 14, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.header-content h1:hover {
    filter: brightness(1.2);
}

.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.search-container input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 1.2rem 1.5rem 1.2rem 3rem;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-container input:focus {
    border-color: var(--accent-violet);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.2), inset 0 2px 5px rgba(0,0,0,0.1);
}

.search-container input:focus + .search-icon {
    color: var(--accent-cyan);
}

/* Emote Grid */
main {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Pack Groups */
.pack-container {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.pack-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pack-header {
    font-size: 1.8rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.emote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Glassmorphic Emote Card */
.emote-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.5s forwards;
}

.emote-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.emote-card:hover {
    transform: translateY(-8px);
    border-color: var(--glass-highlight);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3), 0 0 20px rgba(34, 211, 238, 0.15);
}

.emote-card:hover::before {
    opacity: 1;
}

.emote-image-wrapper {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.emote-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    transition: transform 0.3s;
}

.emote-card:hover .emote-image-wrapper img {
    transform: scale(1.1);
}

.emote-details {
    text-align: center;
    z-index: 1;
    width: 100%;
}

.emote-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    word-break: break-word;
}

.emote-pack {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Click Animation */
.emote-card.clicked {
    transform: scale(0.95);
    border-color: var(--accent-cyan);
    transition: all 0.1s;
}

/* Animations */
@keyframes fadeUpIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
}

.no-results h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Modal UI */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--text-main); }

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-image-wrapper {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}

.modal-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    width: 100%;
}
.modal-keywords span {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn svg { width: 20px; height: 20px; }

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    border: none;
    color: #000;
    box-shadow: 0 5px 15px rgba(129, 140, 248, 0.3);
}
.action-btn.primary:hover {
    box-shadow: 0 8px 20px rgba(129, 140, 248, 0.5);
}

.action-warning {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.4rem;
    margin-bottom: 0.2rem;
    opacity: 0.8;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(34, 211, 238, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--accent-cyan);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.2);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-cyan);
}

/* Responsive */
@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .search-container {
        max-width: 400px;
    }
}
