/* ===== CSS Variables ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.65);
    --bg-card-hover: rgba(30, 30, 45, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --text-muted: #6b6b7b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --glow: rgba(102, 126, 234, 0.3);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: 0.25s 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', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Background Image ===== */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
            linear-gradient(180deg,
            rgba(10, 10, 15, 0.7) 0%,
            rgba(10, 10, 15, 0.85) 50%,
            rgba(10, 10, 15, 0.92) 100%
            ),
            url('../assets/images/background.png') center/cover no-repeat fixed;
}

/* ===== Animated Particles ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 10px var(--primary);
    animation: floatParticle 15s infinite;
}

.particle:nth-child(1) { left: 5%; animation-delay: 0s; }
.particle:nth-child(2) { left: 15%; animation-delay: 2s; }
.particle:nth-child(3) { left: 25%; animation-delay: 4s; }
.particle:nth-child(4) { left: 35%; animation-delay: 1s; }
.particle:nth-child(5) { left: 45%; animation-delay: 3s; }
.particle:nth-child(6) { left: 55%; animation-delay: 5s; }
.particle:nth-child(7) { left: 65%; animation-delay: 2.5s; }
.particle:nth-child(8) { left: 75%; animation-delay: 4.5s; }
.particle:nth-child(9) { left: 85%; animation-delay: 1.5s; }
.particle:nth-child(10) { left: 95%; animation-delay: 3.5s; }
.particle:nth-child(11) { left: 10%; animation-delay: 0.5s; }
.particle:nth-child(12) { left: 90%; animation-delay: 2.8s; }

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) scale(1.2);
        opacity: 0;
    }
}

/* ===== Floating Orbs ===== */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: orbFloat 25s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    opacity: 0.15;
    top: -150px;
    right: -150px;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    opacity: 0.1;
    bottom: -100px;
    left: -100px;
    animation-delay: -12s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    opacity: 0.08;
    top: 40%;
    left: 60%;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(40px, -40px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* ===== Main Container ===== */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== Hero Section ===== */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

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

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 520px;
    margin: 0 auto;
}

/* ===== Search Container ===== */
.search-container {
    width: 100%;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow), 0 12px 40px rgba(0, 0, 0, 0.3);
}

#usernameInput {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    outline: none;
    padding: 18px 24px;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-family: inherit;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

#usernameInput:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

#usernameInput::placeholder {
    color: var(--text-muted);
}

.check-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 36px;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
}

.check-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    z-index: -1;
    opacity: 0;
    filter: blur(12px);
    transition: var(--transition);
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
    background-position: 100% 100%;
    animation: gradientFlow 3s ease infinite;
}

.check-btn:hover::before {
    opacity: 0.8;
}

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

.check-btn:active {
    transform: translateY(0);
}

.btn-text, .btn-icon {
    position: relative;
    z-index: 1;
}

.char-counter {
    text-align: right;
    padding-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ===== Result Card ===== */
.result-card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.result-card.hidden {
    display: none;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
}

.result-card.success::before {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.result-card.error::before {
    background: linear-gradient(90deg, var(--error), #f87171);
}

.result-card.warning::before {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.result-icon-wrapper {
    width: 90px;
    height: 90px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    animation: scaleIn 0.4s ease-out;
}

.result-card.success .result-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.result-card.error .result-icon-wrapper {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.result-card.warning .result-icon-wrapper {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#resultTitle {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

#resultMessage {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.result-details {
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ===== Guidelines Section ===== */
.guidelines-section {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.guidelines-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.guidelines-header svg {
    color: var(--primary);
    flex-shrink: 0;
}

.guidelines-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.guideline-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.guideline-card:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.guideline-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.guideline-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.guideline-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.guideline-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.guideline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    .hero-section {
        margin-bottom: 40px;
    }

    .search-box {
        padding: 24px;
    }

    #usernameInput {
        padding: 16px 20px;
        font-size: 1.05rem;
    }

    .check-btn {
        padding: 16px 28px;
    }

    .result-card {
        padding: 36px 24px;
    }

    .guidelines-section {
        padding: 28px;
    }

    .guidelines-grid {
        grid-template-columns: 1fr;
    }
}