* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f9f7fe;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #6a5acd;
    margin-bottom: 25px;
    font-size: 2.2rem;
}

h2 {
    color: #6a5acd;
    margin: 20px 0 10px;
    font-size: 1.5rem;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.gender-filter {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.gender-filter label {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #f0ebff;
    transition: all 0.3s ease;
}

.gender-filter label:hover {
    background-color: #e0d8ff;
}

.gender-filter input[type="radio"] {
    margin-right: 5px;
}

button {
    background-color: #6a5acd;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #5a4abf;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.result {
    background-color: #f0ebff;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

#name-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #6a5acd;
    margin-bottom: 10px;
}

#gender-icon {
    font-size: 1.5rem;
}

.favorites {
    border-top: 1px solid #ddd;
    margin-top: 30px;
    background-color: #f5f5ff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#add-favorite {
    margin: 10px 0;
    background-color: #ff6b6b;
}

#add-favorite:hover {
    background-color: #ff5252;
}

#favorites-list {
    list-style: none;
    margin-top: 15px;
    min-height: 20px; /* Ensure the list has some height even when empty */
    border: 1px dashed #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: white;
}

#favorites-list li {
    background-color: #f0ebff;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
}

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

.boy-name {
    color: #4a90e2;
}

.girl-name {
    color: #ff6b6b;
}

.remove-favorite {
    background-color: transparent;
    color: #ff5252;
    padding: 5px 10px;
    font-size: 0.8rem;
}

.remove-favorite:hover {
    background-color: #ffebeb;
}

@media (max-width: 650px) {
    .container {
        margin: 20px 10px;
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    #name-display {
        font-size: 1.5rem;
    }
}