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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-card: rgba(21, 27, 46, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #a78bfa;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --border-color: rgba(148, 163, 184, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1629 50%, var(--bg-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 25% 60%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 30%, rgba(167, 139, 250, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    z-index: 100;
    box-shadow: var(--shadow);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.connection-status.connected .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.connection-status.error .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.container {
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 50%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.search-container {
    position: relative;
    margin-bottom: 24px;
    animation: fadeIn 0.6s ease 0.2s backwards;
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 0 24px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 32px rgba(59, 130, 246, 0.3), var(--shadow);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.search-box:focus-within .search-icon {
    color: var(--accent-blue);
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 22px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    background: transparent;
    font-weight: 400;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

.clear-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-button:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

.clear-button:active {
    transform: scale(0.95);
}

.suggestions {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: none;
}

.suggestions.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    padding: 18px 24px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.15s ease;
}

.suggestion-item:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.suggestion-item:hover::before {
    opacity: 1;
}

.suggestion-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 0.975rem;
}

.suggestion-siglas {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.results {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 52px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: none;
}

.results.show {
    display: block;
    animation: scaleIn 0.3s ease;
}

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

.result-card {
    text-align: center;
}

.result-name {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.result-type {
    display: inline-block;
    padding: 20px 52px;
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    position: relative;
    overflow: hidden;
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

.result-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.result-type:hover::before {
    left: 100%;
}

.type-sindical {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.type-prepaga {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.type-estatal {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.result-siglas {
    margin-top: 36px;
    padding-top: 36px;
    border-top: 1px solid var(--border-color);
}

.result-siglas-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.result-siglas-list {
    font-size: 1.1rem;
    color: #cbd5e1;
    font-weight: 400;
    line-height: 1.7;
}

.no-results {
    text-align: center;
    padding: 52px 28px;
}

.no-results-icon {
    font-size: 4.5rem;
    margin-bottom: 24px;
    opacity: 0.25;
}

.no-results-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.no-results-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.stats {
    text-align: center;
    margin-top: 28px;
    animation: fadeIn 0.6s ease 0.4s backwards;
}

.stats-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-content svg {
    color: var(--accent-blue);
}

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

.suggestions::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

.suggestions::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 10px;
}

.suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .connection-status {
        top: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .header {
        margin-bottom: 36px;
    }
    
    .header h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-box {
        border-radius: 16px;
        padding: 0 18px;
    }
    
    #searchInput {
        padding: 18px 0;
        font-size: 1rem;
    }
    
    .suggestions {
        max-height: 320px;
        border-radius: 16px;
    }
    
    .suggestion-item {
        padding: 16px 18px;
    }
    
    .results {
        padding: 40px 24px;
        border-radius: 16px;
    }
    
    .result-name {
        font-size: 1.75rem;
        margin-bottom: 24px;
    }
    
    .result-type {
        font-size: 1.2rem;
        padding: 16px 36px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .connection-status {
        position: static;
        margin: 0 auto 16px;
        width: fit-content;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    #searchInput {
        font-size: 0.95rem;
    }
    
    .results {
        padding: 32px 20px;
    }
    
    .result-name {
        font-size: 1.5rem;
    }
    
    .result-type {
        font-size: 1.05rem;
        padding: 14px 32px;
        letter-spacing: 1.5px;
    }
}
