/* --- Base --- */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
    background: #f3f3f3;
    color: #1f1f1f;
    text-align: center;
    -webkit-text-size-adjust: 100%;
}

header {
    padding: 3rem 1rem 2rem;
}

header h1 {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 600;
}

header p {
    margin-top: 0.8rem;
    color: #666;
}

/* --- Search Box --- */
.search-box {
    margin: 2rem auto;
    max-width: 420px;
    display: flex;
    flex-direction: row; /* keep input and button side by side */
    gap: 0.5rem;
    padding: 0 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.search-box button {
    flex-shrink: 0;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    border: none;
    background: #e8ddc7;
    cursor: pointer;
    font-size: 1rem;
}

/* --- Country List Layout (image left, name right) --- */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card-row {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: inherit;

    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 6px 14px rgba(0,0,0,0.06),
        0 18px 40px rgba(0,0,0,0.05);

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-row:hover {
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.08),
        0 10px 22px rgba(0,0,0,0.08),
        0 24px 50px rgba(0,0,0,0.07);
}

.card-row img {
    width: 60px;
    height: auto;
    border-radius: 8px;
    margin-right: 1.2rem;
}

.card-row h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-align: left;
}

/* --- Country Output --- */
#countryOutput {
    max-width: 720px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 6px 14px rgba(0,0,0,0.06);
    text-align: left;
}

/* --- Autosuggestions --- */
.suggestions {
    max-width: 420px;
    margin: 0.5rem auto 0;
    background: #fff;
    border-radius: 8px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 6px 14px rgba(0,0,0,0.06);
    overflow: hidden;
    display: none;
}

.suggestion-item {
    padding: 0.6rem 0.9rem;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

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

.suggestion-item:hover {
    background: #f7f7f7;
}

/* --- Mobile Layout Fixes --- */
@media (max-width: 600px) {
    body {
        font-size: 16px;
        line-height: 1.6;
        padding: 0 1rem;
    }

    header {
        padding: 2rem 1rem 1.5rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .card-list {
        padding: 0 0.5rem;
        gap: 0.8rem;
    }

    .card-row {
        padding: 0.7rem 0.8rem;
        gap: 0.8rem;
    }

    .card-row img {
        width: 44px;
        margin-right: 0.8rem;
    }

    .card-row h3 {
        font-size: 1rem;
    }

    #countryOutput {
        font-size: 1rem;
        line-height: 1.65;
        padding: 1.2rem;
        margin: 1.5rem 0.5rem;
    }

    #countryOutput h1,
    #countryOutput h2,
    #countryOutput h3 {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    #countryOutput p {
        font-size: 1rem;
    }

    #countryOutput img {
        max-width: 100%;
        height: auto;
    }

    .suggestions {
        max-width: 100%;
        margin: 0.5rem 1rem;
    }

    .suggestion-item {
        padding: 0.7rem 1rem;
        font-size: 1rem;
    }
}

