@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Goldman:wght@700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #101010;
    color: #e0e0e0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 80dvh;
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(50vh - 150px);
    transition: padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container.has-results {
    padding-top: 40px;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

/* Logo */
.logo {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 40px;
    font-family: 'Goldman', sans-serif;
    color: #b9b9b9;
    letter-spacing: -1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 3px rgba(255, 255, 255, 0.15);
}

.search-container.has-results .logo {
    font-size: 28px;
    margin-bottom: 25px;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: radial-gradient(80% 80% at 30% 20%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.search-input-wrapper:focus-within::before {
    opacity: 0.9;
    background: radial-gradient(90% 90% at 30% 20%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(36, 36, 36, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #e0e0e0;
    box-shadow:
        inset 0 0 1.5px 1px rgba(255, 255, 255, 0.07),
        0 1px 2px rgba(0,0,0,0.2);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    position: relative;
    z-index: 2; /* Ensure input is above the pseudo-element */
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        inset 0 0 1.5px 1px rgba(255, 255, 255, 0.07),
        0 0 12px rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0,0,0,0.2);
}

.search-input::placeholder {
    color: #888;
    transition: color 0.3s ease;
}

.search-input:focus::placeholder {
    color: #666;
}

/* Tooltip */
.tooltip-trigger-icon {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 500;
    color: #666;
    cursor: help;
    transition: color 0.2s ease;
    z-index: 3;
    user-select: none;
}

.tooltip-trigger-icon:hover {
    color: #999;
}

.tooltip-content {
    width: 100%;
    max-width: 600px;
    padding: 12px;
    margin-top: 12px;
    background-color: rgba(36, 36, 36, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 0 1.5px 1px rgba(255, 255, 255, 0.05),
        0 1px 3px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.tooltip-content.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip-content:hover {
    background-color: rgba(36, 36, 36, 0.7);
    border-color: rgba(255, 255, 255, 0.25);
}

.tooltip-content h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: #fff;
    font-weight: 500;
}

.tooltip-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-content li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #bbb;
}

.tooltip-content li:last-child {
    margin-bottom: 0;
}

.tooltip-content code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Inter', monospace;
    color: #a6e22e;
    font-size: 13px;
}

/* Results Container */
.search-results-wrapper {
    position: relative;
    margin-top: 30px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.results, .loading-indicator, .no-results {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.results.is-visible,
.loading-indicator.is-visible,
.no-results.is-visible {
    position: static;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.results.is-loading {
    opacity: 0.5;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.results {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Result Item (Anime Card) */
.result-item {
    display: flex;
    width: 100%;
    max-width: 600px; /* фиксированная ширина карточек */
    padding: 12px;
    margin-bottom: 12px;
    background-color: rgba(36, 36, 36, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 1.5px 1px rgba(255, 255, 255, 0.05),
        0 1px 3px rgba(0,0,0,0.2);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: radial-gradient(80% 80% at 70% 20%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    opacity: 0.5;
    transition: all 0.3s ease;
    pointer-events: none;
}

.result-item:hover::before {
    opacity: 0.8;
    background: radial-gradient(90% 90% at 70% 20%, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.25);
    background-color: rgba(36, 36, 36, 0.7);
}

/* Anime Poster */
.result-poster {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 16px;
    background: #333;
    flex-shrink: 0;
}

/* Anime Info */
.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.meta-separator {
    margin: 0 6px;
    color: #555;
    font-weight: 700;
}

.meta-score {
    color: #ffd700;
}

.meta-status {
    font-weight: 500;
}

.status-released { /* Вышло */
    color: #A6E22E;
    text-shadow: 0 0 8px rgba(166, 226, 46, 0.35);
}

.status-anons { /* Анонс */
    color: #F92672;
    text-shadow: 0 0 8px rgba(249, 38, 114, 0.35);
}

.status-ongoing { /* Онгоинг */
    color: #66D9EF;
    text-shadow: 0 0 8px rgba(102, 217, 239, 0.4);
}

.result-description {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Loading State */
.loading-indicator, .no-results {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    text-align: center;
    transition-delay: 0.1s;
}

.loading-indicator.is-visible {
    animation: pulse 1.8s ease-in-out infinite;
}

.no-results-text, .loading-indicator {
    font-size: 18px;
    font-weight: 500;
    color: #999;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item.fade-in-stagger {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: var(--animation-delay, 0s);
}

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

/* Footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    width: 100%;
    text-align: center;
    padding: 20px 15px;
    margin-top: 40px;
    font-size: 13px;
    color: #777;
    transition: all 0.3s ease;
    line-height: 1.5;
    margin-bottom: 10px;
}

footer:hover {
    color: #888;
}

footer a {
    color: #999;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

footer a:hover {
    color: #ccc;
    border-bottom-color: #777;
}

.footer-separator {
    margin: 0 8px;
    color: #666;
}

.footer-separator::after {
    content: '//';
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .container {
        padding: 15px;
        min-height: 90dvh;
    }
    
    .logo {
        font-size: 36px;
        margin-bottom: 30px;
    }
    
    .search-input {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .result-item {
        padding: 10px;
    }
    
    .result-poster {
        width: 50px;
        height: 70px;
        margin-right: 12px;
    }
    
    .result-title {
        font-size: 15px;
    }
    
    .result-meta {
        font-size: 13px;
    }
    
    .result-description {
        font-size: 12px;
    }

    footer {
        flex-direction: column;
    }

    .footer-separator:after {
        content: '~';
    }
}