/* =========================================
   HYTALE NAMES DATABASE - Modern CSS
   ========================================= */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    --accent-primary: #00f0ff;
    --accent-secondary: #7b2fff;
    --accent-gradient: linear-gradient(135deg, #00f0ff 0%, #7b2fff 100%);
    --accent-glow: rgba(0, 240, 255, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 240, 255, 0.3);
    
    --success: #00ff88;
    --warning: #ffcc00;
    --danger: #ff4466;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(123, 47, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(123, 47, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ---------- Header ---------- */
.site-header {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8em;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-fast);
}

.logo:hover {
    transform: scale(1.02);
    filter: brightness(1.2);
}

/* Portal Button */
.btn-portal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: #000;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-portal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.btn-portal:hover::before {
    left: 100%;
}

.btn-portal:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 40px var(--accent-glow);
}

.header-btn-right {
    position: absolute;
    top: 20px;
    right: 30px;
}

/* Search Form */
.search-form {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 550px;
    margin: 20px auto 0;
}

input[type="text"] {
    flex: 1;
    padding: 16px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: var(--transition-fast);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1), var(--shadow-glow);
    background: rgba(0, 240, 255, 0.03);
}

.btn-search {
    padding: 16px 28px;
    background: var(--accent-gradient);
    color: #000;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-search:active {
    transform: scale(0.98);
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ---------- Result Cards ---------- */
.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.result-card:hover {
    border-color: var(--border-glow);
    transform: translateX(8px);
    box-shadow: var(--shadow-sm), 0 0 20px rgba(0, 240, 255, 0.1);
}

.result-card a {
    display: block;
    width: 100%;
    padding: 18px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05em;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    margin-bottom: 24px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--accent-primary);
}

.breadcrumbs .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ---------- Profile View ---------- */
#profile-view {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.username-title {
    display: block;
    text-align: center;
    font-size: 2.5em;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

/* Avatar */
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
    margin: 0 auto 20px;
    display: block;
    object-fit: cover;
}

/* Info Grid */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.label {
    color: var(--text-muted);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.value {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.1em;
}

/* SEO Text Box */
#p-seo-text {
    margin: 30px 0;
    padding: 24px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05) 0%, rgba(123, 47, 255, 0.05) 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
    line-height: 1.7;
}

#p-seo-text h2 {
    color: var(--text-primary);
    font-size: 1.15em;
    margin-bottom: 12px;
}

/* ---------- Analysis Container ---------- */
.analysis-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 30px;
}

.stat-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition-fast);
}

.stat-box:hover {
    border-color: var(--border-glow);
    background: rgba(0, 240, 255, 0.03);
}

.stat-box h4 {
    color: var(--text-muted);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-box span {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1em;
}

/* Rarity Tags */
.rarity-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.75em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rarity-common {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 160, 176, 0.3);
}

.rarity-rare {
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.rarity-legendary {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.2) 0%, rgba(255, 136, 0, 0.2) 100%);
    color: var(--warning);
    border: 1px solid rgba(255, 204, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 204, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 204, 0, 0.5); }
}

/* ---------- Skin Details ---------- */
.skin-container {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.skin-container h4 {
    color: var(--text-muted);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.skin-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skin-label {
    color: var(--text-muted);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skin-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9em;
}

/* ---------- Name History ---------- */
.history-container {
    margin-top: 30px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(123, 47, 255, 0.05) 0%, rgba(0, 240, 255, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-container h4 {
    color: var(--text-muted);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.history-item:hover {
    border-color: var(--border-glow);
}

.history-name {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85em;
}

.current-badge {
    background: var(--accent-gradient);
    color: #000;
    font-size: 0.65em;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.old-badge {
    background: rgba(160, 160, 176, 0.2);
    color: var(--text-muted);
    font-size: 0.65em;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-single {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05) 0%, rgba(123, 47, 255, 0.05) 100%);
    border-color: var(--border-glow);
}

/* ---------- Variations ---------- */
.variations-container {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.variations-container h4 {
    color: var(--text-muted);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.var-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.var-tag {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: var(--transition-fast);
}

.var-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-2px);
}

/* ---------- Related Names ---------- */
.related-title {
    color: var(--text-muted);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin: 40px 0 20px;
}

.related-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-related {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-related:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(123, 47, 255, 0.1);
    box-shadow: 0 0 20px rgba(123, 47, 255, 0.2);
    transform: translateY(-3px);
}

/* ---------- Trending Section ---------- */
.trending-container {
    margin: 20px 0 50px;
}

.trending-title {
    color: var(--text-primary);
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 24px;
    padding-left: 16px;
    border-left: 4px solid;
    border-image: var(--accent-gradient) 1;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.trending-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.trending-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition-smooth);
}

.trending-card:hover {
    border-color: transparent;
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md), 0 0 30px rgba(0, 240, 255, 0.15);
}

.trending-card:hover::before {
    opacity: 0.1;
}

.t-name {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.t-views {
    display: block;
    color: var(--text-muted);
    font-size: 0.75em;
    position: relative;
    z-index: 1;
    transition: var(--transition-fast);
}

.trending-card:hover .t-views {
    color: var(--accent-primary);
}

/* ---------- SEO Content ---------- */
.seo-container {
    max-width: 800px;
    margin: 50px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.seo-intro, .seo-faq {
    margin-bottom: 40px;
}

.seo-container h1 {
    font-size: 1.8em;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.seo-container h2 {
    color: var(--text-primary);
    font-size: 1.4em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.seo-container p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.seo-container strong {
    color: var(--accent-primary);
}

.seo-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 40px 0;
}

.faq-item {
    margin-bottom: 28px;
    padding: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--border-glow);
}

.faq-item h3 {
    color: var(--text-primary);
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85em;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-col h4 {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    padding: 4px 0;
    transition: var(--transition-fast);
}

.footer-col a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8em;
}

@media (max-width: 600px) {
    .footer-main {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links {
        gap: 40px;
    }
    
    .footer-brand {
        max-width: 100%;
    }
}

/* ---------- Loader ---------- */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Utility Classes ---------- */
.hidden {
    display: none !important;
}

/* Available Badge */
.status-available {
    color: var(--success);
    font-weight: 700;
}

.status-taken {
    color: var(--danger);
    font-weight: 700;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .trending-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header-btn-right {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 16px;
    }
    
    .site-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 16px 20px;
    }
    
    .logo {
        font-size: 1.5em;
        order: 1;
    }
    
    .header-btn-right {
        order: 2;
    }
    
    .search-form {
        order: 3;
        width: 100%;
        flex-direction: column;
    }
    
    .btn-search {
        width: 100%;
    }
    
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .analysis-container {
        grid-template-columns: 1fr;
    }
    
    #profile-view {
        padding: 24px 20px;
    }
    
    .username-title {
        font-size: 1.8em;
    }
}

@media (max-width: 500px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .var-tags {
        justify-content: center;
    }
    
    .btn-portal {
        padding: 10px 18px;
        font-size: 0.8em;
    }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(0, 240, 255, 0.3);
    color: var(--text-primary);
}