* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #141414 0%, #0c0c0c 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    min-width: 360px;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
    radial-gradient(circle at 20% 30%, rgba(229, 9, 20, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(229, 9, 20, 0.08) 0%, transparent 40%),
    repeating-linear-gradient(45deg, rgba(20, 20, 20, 0.1) 0px, rgba(20, 20, 20, 0.1) 1px, transparent 1px, transparent 11px),
    repeating-linear-gradient(135deg, rgba(20, 20, 20, 0.1) 0px, rgba(20, 20, 20, 0.1) 1px, transparent 1px, transparent 11px);
    z-index: -1;
}

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

/* Server Selector */
.server-selector {
    align-self: flex-end;
    transition: all 0.6s ease;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-select {
    background: #222;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.dropdown-select:hover {
    background: #e50914;
}

.dropdown-select i {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-select i {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    right: 0;
    background: #222;
    border-radius: 10px;
    width: 100%;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.dropdown.active .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.dropdown-option:hover {
    background: #e50914;
    color: white;
    font-weight: 600;
}

.dropdown-option:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
    
.dropdown-option:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Header and Title */
header {
    margin-bottom: 40px;
    position: relative;
}

.title {
    font-size: 5rem;
    font-weight: 800;
    color: #e50914;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    margin-top: 20px;
    position: relative;
    display: inline-block;
}

.title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 4px;
    background: #e50914;
    border-radius: 3px;
}

/* Selector Container */
.selector-container {
    margin-bottom: 40px;
    min-width: max-content;
    white-space: nowrap;
}

.selector {
    background: #222;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.option {
    padding: 12px 40px;
    cursor: pointer;
    z-index: 2;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: color 0.3s ease;
}

.option.selected {
    color: white;
    font-weight: 800;
}

.option:not(.selected) {
    color: #888;
}

.slider {
    position: absolute;
    height: calc(100% - 12px);
    width: calc(50% - 6px);
    background: #e50914;
    border-radius: 50px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.4);
}

/* Search Bar */
.search-container {
    margin-bottom: 50px;
    max-width: 600px;
    width: 100%;
    min-width: 90px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #222;
    border-radius: 50px;
    padding: 12px 25px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-bar:focus-within {
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.3);
    transform: translateY(-2px);
}

.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.1rem;
    padding: 8px 15px;
    outline: none;
}

.search-icon {
    color: #e50914;
    font-size: 1.5rem;
    margin-right: 10px;
}

/* Content Placeholder */
.content {
    text-align: center;
    opacity: 0.7;
}

.content i {
    font-size: 5rem;
    color: #e50914;
    margin-bottom: 20px;
}

.content p {
    margin-bottom: 40px;
}

/* Results Container */
.results-container {
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* ------- FOCUS STATE (when typing) ------- */

.search-focused .main-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center; 
    margin-bottom: 40px;
    gap: 20px;
}

/* Header and Content */
.search-focused header,
.search-focused .content {
    display: none;
}

/* Server-Selector */
.search-focused .server-selector {
    align-self: flex-start;
    order: 1;
}

/* Search-Container */
.search-focused .search-container {
    margin-bottom: 0;
}

/* Selector-Container */
.search-focused .selector-container {
    margin-bottom: 0;
}

/* Results Container */
.search-focused .results-container {
    opacity: 1;
    flex: 1;
}

/* Result Cards */
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.result-card {
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.3);
}

.card-image {
    height: 150px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.card-content {
    padding: 10px 15px;
}

.card-content p {
    color: #aaa;
    font-size: 0.8rem;
}

.card-content h3 {
    overflow: hidden;
    margin-bottom: 10px;
    color: white;
    font-size: 0.9rem;
}

.card-content h3 span {
    display: inline-block;
    white-space: nowrap;
}

.result-card:hover .card-content.overflowing h3 span {
    animation: scroll-text 5s linear infinite;
}

@keyframes scroll-text {
    from {
    transform: translateX(0);
    }
    to {
    transform: translateX(-100%);
    }
}