/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #351b30;
    font-family: 'Source Sans Pro', Arial, sans-serif;
}

body {
    color: rgba(220, 192, 210, 0.8);
    font-size: 1rem;
    line-height: 1.4;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.header {
    padding: 2rem 0 4rem;
}

.logo svg {
    display: block;
}

/* Main */
.main {
    padding: 2rem 0;
}

.main-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Stats Section */
.stats-section {
    width: 400px;
    flex-shrink: 0;
}

.stats-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: left;
    letter-spacing: 0.1em;
}

.stats-update {
    color: rgba(220, 192, 210, 0.5);
    font-size: 0.75rem;
    font-weight: 400;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
}

.stat-item.world {
    background-color: transparent;
    border-bottom: 1px solid rgba(220, 192, 210, 0.2);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.stat-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    flex-shrink: 0;
}

.stat-flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

.stat-flag img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.stat-country {
    color: rgba(220, 192, 210, 0.9);
    font-size: 0.9rem;
    min-width: 100px;
}

.stat-count {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: auto;
}

.stat-label {
    color: rgba(220, 192, 210, 0.6);
    font-size: 0.85rem;
}

/* Search Section */
.search-section {
    flex: 1;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.search-column {
    flex: 1;
    max-width: 600px;
}

.filters-column {
    width: 300px;
    flex-shrink: 0;
}

.search-title,
.filters-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.filter-toggle-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: rgba(220, 192, 210, 0.9);
    background-color: #5a2d52;
    border: none;
    cursor: pointer;
    text-align: left;
    margin-bottom: 1rem;
}

.filter-toggle-btn:hover {
    background-color: #6b3562;
}

.filter-toggle-btn.active {
    background-color: #7a3d72;
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1.1rem;
    font-family: inherit;
    color: rgba(220, 192, 210, 0.9);
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(51, 241, 229, 0.3);
    text-align: left;
}

.search-input:focus {
    outline: none;
    border-bottom-color: #33f1e5;
}

.search-input::placeholder {
    color: rgba(220, 192, 210, 0.4);
}

/* Autocomplete */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a1625;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border-top: 1px solid rgba(220, 192, 210, 0.2);
    text-align: left;
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: rgba(220, 192, 210, 0.8);
    border-bottom: 1px solid rgba(220, 192, 210, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.flag-icon {
    display: inline-flex;
    align-items: center;
    width: 24px;
    height: 16px;
    flex-shrink: 0;
}

.flag-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: rgba(51, 241, 229, 0.15);
    color: #33f1e5;
}

.autocomplete-item mark {
    background: transparent;
    color: #ffdd57;
    font-weight: 600;
}

/* Avatar Container */
.avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 2px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    display: block;
}

.flag-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a1625;
    background-color: #2a1625;
}

.flag-overlay svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Scrollbar */
.autocomplete-list::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.autocomplete-list::-webkit-scrollbar-thumb {
    background: rgba(51, 241, 229, 0.3);
    border-radius: 4px;
}

.autocomplete-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 241, 229, 0.5);
}

/* Filter Panel */
.filter-panel {
    display: none;
}

.filter-panel.show {
    display: block;
}

.filter-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-height: 400px;
    overflow-y: auto;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: transparent;
}

.filter-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    flex-shrink: 0;
}

.filter-flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

.filter-country {
    color: rgba(220, 192, 210, 0.9);
    font-size: 0.9rem;
    min-width: 100px;
}

.filter-count {
    color: rgba(220, 192, 210, 0.7);
    font-size: 0.85rem;
    margin-left: auto;
    margin-right: 1rem;
}

.filter-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.switch-toggle {
    position: relative;
    width: 36px;
    height: 18px;
    background-color: #5a2d52;
    flex-shrink: 0;
}

.switch-toggle.active {
    background-color: #33f1e5;
}

.switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background-color: rgba(220, 192, 210, 0.9);
    transition: left 0.2s;
}

.switch-toggle.active .switch-slider {
    left: 20px;
}

.switch-label {
    color: rgba(220, 192, 210, 0.7);
    font-size: 0.85rem;
    white-space: nowrap;
}

.filter-panel::-webkit-scrollbar {
    width: 8px;
}

.filter-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.filter-panel::-webkit-scrollbar-thumb {
    background: rgba(51, 241, 229, 0.3);
}

.filter-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 241, 229, 0.5);
}

.filter-content::-webkit-scrollbar {
    width: 8px;
}

.filter-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.filter-content::-webkit-scrollbar-thumb {
    background: rgba(51, 241, 229, 0.3);
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 241, 229, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .logo svg {
        width: 200px;
        height: auto;
    }
    
    .search-title,
    .filters-title {
        font-size: 1.5rem;
    }
    
    .search-input {
        font-size: 1.25rem;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .stats-section {
        width: 100%;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-column {
        max-width: 100%;
    }
    
    .filters-column {
        width: 100%;
    }
}

/* Footer */
.footer {
    padding: 3rem 0 2rem;
    text-align: center;
}

.footer-text {
    color: rgba(220, 192, 210, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

.search-footer {
    margin-top: 1rem;
    color: rgba(220, 192, 210, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
}

.footer-link {
    color: #33f1e5;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #5ff5eb;
    text-decoration: underline;
}
