/* ==========================================================================
   Colette DN — Top Bar Layout
   ========================================================================== */

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

:root {
    --bg: #0a0a0a;
    --bg-bar: #0d0d0d;
    --bg-card: #131313;
    --cream: #f5f5f0;
    --cream-dim: #777;
    --gold: #c4a855;
    --gold-dim: #8a7a3d;
    --success: #6b9e67;
    --success-bg: rgba(107, 158, 103, 0.1);
    --error: #c75f5f;
    --border: rgba(255, 255, 255, 0.06);
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--cream);
    min-height: 100vh;
}

/* ==========================================================================
   Hero State (Landing Page)
   ========================================================================== */

.hero-state {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.6s var(--ease);
}

.hero-state[hidden] {
    display: none;
}

.hero-content {
    text-align: center;
    max-width: 560px;
    width: 100%;
}

.hero-logo {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.hero-mark {
    color: var(--gold);
    font-size: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--cream);
    letter-spacing: -0.02em;
}

.hero-suffix {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--cream-dim);
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    opacity: 0.5;
}

.hero-tagline {
    font-size: 1rem;
    color: var(--cream-dim);
    margin-bottom: 3rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 300;
}

.hero-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-input::placeholder {
    color: var(--cream-dim);
}

.hero-input:focus {
    outline: none;
    border-color: var(--gold-dim);
    background: rgba(255, 255, 255, 0.05);
}

.hero-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.hero-tld-toggle {
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--cream-dim);
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-tld-toggle:hover {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--cream);
}

.hero-tld-toggle.active {
    border-color: var(--gold-dim);
    color: var(--cream);
}

.hero-submit {
    padding: 1rem 2.5rem;
    background: var(--gold);
    border: none;
    border-radius: 4px;
    color: #0a0a0a;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
}

.hero-submit:hover:not(:disabled) {
    background: var(--cream);
}

.hero-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hero-btn-text, .hero-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hero-btn-text[hidden], .hero-btn-loading[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-input {
        font-size: 1rem;
        padding: 1rem;
    }

    .hero-options {
        flex-direction: column;
    }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-layout[hidden] {
    display: none;
}

/* ==========================================================================
   Top Bar
   ========================================================================== */

.top-bar {
    background: var(--bg-bar);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 900px) {
    .top-bar {
        flex-wrap: wrap;
        padding: 1.25rem 1.25rem;
        gap: 1rem;
    }
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-shrink: 0;
}

.logo-mark {
    color: var(--gold);
    font-size: 0.9rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    font-style: italic;
    color: var(--cream);
}

.logo-suffix {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cream-dim);
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
    opacity: 0.6;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.search-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 900px;
}

@media (max-width: 900px) {
    .search-form {
        width: 100%;
        flex-wrap: wrap;
    }
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

.search-input::placeholder {
    color: var(--cream-dim);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-dim);
    background: rgba(255, 255, 255, 0.05);
}

/* Search Options */
.search-options {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.tld-toggle {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--cream-dim);
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tld-toggle:hover {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--cream);
}

.tld-toggle.active {
    border-color: var(--gold-dim);
    color: var(--cream);
}

/* Submit Button */
.submit-btn {
    padding: 0.6rem 1.25rem;
    background: var(--gold);
    border: none;
    border-radius: 3px;
    color: #0a0a0a;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.submit-btn:hover:not(:disabled) {
    background: var(--cream);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-text, .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-text[hidden], .btn-loading[hidden] {
    display: none;
}

.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .main-content {
        padding: 2rem 1.25rem;
    }
}

/* Empty State */
.empty-state {
    height: 100%;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-state p {
    font-size: 1rem;
    color: var(--cream-dim);
    line-height: 1.8;
    opacity: 0.4;
}

.empty-state[hidden] {
    display: none;
}

/* ==========================================================================
   Results
   ========================================================================== */

/* Searching State */
.searching-state {
    column-span: all;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    gap: 1.5rem;
}

.search-animation {
    position: relative;
    width: 100px;
    height: 100px;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--gold);
    animation: searchPulse 2s ease-in-out infinite;
}

.orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: orbit 3s linear infinite;
}

.orbit-reverse {
    animation: orbit 4s linear infinite reverse;
}

.orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.6;
}

.orbit-dot:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-dot:nth-child(2) {
    bottom: 15%;
    left: 15%;
}

.orbit-dot:nth-child(3) {
    bottom: 15%;
    right: 15%;
}

.orbit-reverse .orbit-dot:nth-child(1) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.orbit-reverse .orbit-dot:nth-child(2) {
    top: 50%;
    right: 0;
    left: auto;
    transform: translateY(-50%);
}

.search-text {
    font-size: 0.95rem;
    color: var(--gold);
}

.search-subtext {
    font-size: 0.75rem;
    color: var(--cream-dim);
    margin-top: -0.75rem;
}

.search-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

.tld-parade {
    display: flex;
    gap: 1rem;
    overflow: hidden;
}

.tld-parade span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cream-dim);
    opacity: 0;
    animation: tldFade 3s ease-in-out infinite;
}

.tld-parade span:nth-child(1) { animation-delay: 0s; }
.tld-parade span:nth-child(2) { animation-delay: 0.5s; }
.tld-parade span:nth-child(3) { animation-delay: 1s; }
.tld-parade span:nth-child(4) { animation-delay: 1.5s; }
.tld-parade span:nth-child(5) { animation-delay: 2s; }
.tld-parade span:nth-child(6) { animation-delay: 2.5s; }

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes searchPulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

@keyframes tldFade {
    0%, 100% { opacity: 0; transform: translateY(5px); }
    20%, 80% { opacity: 0.6; transform: translateY(0); }
}

/* Rounds Badge - subtle inline indicator */
.rounds-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--cream-dim);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.results {
    column-count: 2;
    column-gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .results {
        column-count: 1;
    }
}

.results[hidden] {
    display: none;
}

/* Category Section */
.category {
    break-inside: avoid;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.5s var(--ease) both;
}

.category:nth-child(1) { animation-delay: 0s; }
.category:nth-child(2) { animation-delay: 0.08s; }
.category:nth-child(3) { animation-delay: 0.16s; }
.category:nth-child(4) { animation-delay: 0.24s; }

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--cream);
    white-space: nowrap;
}

.category-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cream-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

.category-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Empty Category */
.category-empty {
    opacity: 0.5;
}

.empty-category {
    font-size: 0.8rem;
    color: var(--cream-dim);
    font-style: italic;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
    border-radius: 3px;
}

/* Domain Grid */
.domain-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Domain Card */
.domain-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    transition: all 0.2s ease;
    animation: slideUp 0.4s var(--ease) both;
}

.domain-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.domain-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--cream);
    word-break: break-all;
}

.domain-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.domain-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.domain-status {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

.domain-status.available {
    background: var(--success-bg);
    color: var(--success);
}

.domain-status.checking {
    background: rgba(196, 168, 85, 0.1);
    color: var(--gold);
    animation: pulse 1.5s ease-in-out infinite;
}

.domain-status.unverified {
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream-dim);
}

.domain-price {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--success);
}

.domain-premium {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.125rem 0.35rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #0a0a0a;
    border-radius: 2px;
}

.domain-link {
    font-size: 0.7rem;
    color: var(--gold-dim);
    text-decoration: none;
    transition: color 0.15s ease;
}

.domain-link:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* Cache Refresh */
.cache-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--cream-dim);
    font-family: var(--font-body);
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cache-refresh:hover {
    border-color: rgba(196, 168, 85, 0.3);
    color: var(--cream);
}

.cache-time {
    opacity: 0.7;
}

.refresh-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.cache-refresh:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Error Message */
.error-message {
    background: rgba(199, 95, 95, 0.1);
    border: 1px solid rgba(199, 95, 95, 0.2);
    color: var(--error);
    padding: 1rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.app-footer p {
    font-size: 0.65rem;
    color: var(--cream-dim);
    letter-spacing: 0.05em;
    opacity: 0.5;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* ==========================================================================
   Maintenance Overlay
   ========================================================================== */

.maintenance-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s var(--ease);
}

.maintenance-overlay[hidden] {
    display: none;
}

.maintenance-content {
    text-align: center;
    max-width: 400px;
    padding: 3rem;
}

.maintenance-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 2rem;
    animation: gentlePulse 3s ease-in-out infinite;
}

.maintenance-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    font-style: italic;
    color: var(--cream);
    margin-bottom: 1rem;
}

.maintenance-text {
    font-size: 0.95rem;
    color: var(--cream-dim);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.maintenance-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.timer-label {
    font-size: 0.7rem;
    color: var(--cream-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.timer-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.maintenance-retry {
    padding: 0.75rem 2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--cream-dim);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maintenance-retry:hover {
    border-color: var(--gold-dim);
    color: var(--cream);
}

@keyframes gentlePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}
