:root {
    --primary-color: #818cf8;
    /* Indigo 400 */
    --primary-hover: #6366f1;
    /* Indigo 500 */
    --bg-color: #0f172a;
    /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --focus-ring: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero-section {
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.2s forwards;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.4s forwards;
}

.search-bar-wrapper {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px -10px rgba(129, 140, 248, 0.2);
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    padding: 0 1.5rem;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

#domain-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.25rem;
    padding: 1rem 0;
    color: var(--text-main);
    background: transparent;
    font-family: 'Inter', sans-serif;
}

#domain-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

#search-btn {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Loading Indicator */
#loading-indicator {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.loader-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-family: "Inter", sans-serif;
    font-size: 0.3em;
    font-weight: 300;
    color: white;
    border-radius: 50%;
    background-color: transparent;
    user-select: none;
}

.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: transparent;
    animation: loader-rotate 2s linear infinite;
    z-index: 0;
}

@keyframes loader-rotate {
    0% {
        transform: rotate(90deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 30px 0 #ad5fff inset,
            0 60px 60px 0 #471eec inset;
    }

    50% {
        transform: rotate(270deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 10px 0 #d60a47 inset,
            0 40px 60px 0 #311e80 inset;
    }

    100% {
        transform: rotate(450deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 30px 0 #ad5fff inset,
            0 60px 60px 0 #471eec inset;
    }
}

.loader-letter {
    display: inline-block;
    opacity: 0.4;
    transform: translateY(0);
    animation: loader-letter-anim 2s infinite;
    z-index: 1;
    border-radius: 50ch;
    border: none;
}

.loader-letter:nth-child(1) {
    animation-delay: 0s;
}

.loader-letter:nth-child(2) {
    animation-delay: 0.1s;
}

.loader-letter:nth-child(3) {
    animation-delay: 0.2s;
}

.loader-letter:nth-child(4) {
    animation-delay: 0.3s;
}

.loader-letter:nth-child(5) {
    animation-delay: 0.4s;
}

.loader-letter:nth-child(6) {
    animation-delay: 0.5s;
}

.loader-letter:nth-child(7) {
    animation-delay: 0.6s;
}

.loader-letter:nth-child(8) {
    animation-delay: 0.7s;
}

.loader-letter:nth-child(9) {
    animation-delay: 0.8s;
}

.loader-letter:nth-child(10) {
    animation-delay: 0.9s;
}

@keyframes loader-letter-anim {

    0%,
    100% {
        opacity: 0.4;
        transform: translateY(0);
    }

    20% {
        opacity: 1;
        transform: scale(1.15);
    }

    40% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* Results Area */
#results-area {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.result-card:hover::before {
    transform: translateX(100%);
}

.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.domain-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-available {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-taken {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.price-tag {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

.buy-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.buy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
}

.buy-btn.primary {
    background: var(--primary-color);
    color: #0f172a;
    border: none;
}

.buy-btn.primary:hover {
    background: var(--primary-hover);
    color: white;
}

/* Popular Tags */
.popular-extensions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.6s forwards;
}

.tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(129, 140, 248, 0.1);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}