/* ===============================
   COUNTRY INFORMATION FINDER
   Developed by Garang Deng
   =============================== */

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

body{
    background:#f4f7fb;
    color:#222;
    transition:.3s;
    line-height:1.6;
}

/* Dark Mode */
body.dark{
    background:#121212;
    color:#ffffff;
}

/* Header */
header{
    background:#1565c0;
    color:white;
    text-align:center;
    padding:30px 20px;
}

header h1{
    font-size:2rem;
    margin-bottom:8px;
}

header p{
    opacity:.9;
}

/* Main Container */
.container{
    max-width:1000px;
    margin:auto;
    padding:25px;
}

/* Search Section */
.search-area{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:center;
    margin-bottom:25px;
}

.search-area input{
    flex:1;
    min-width:250px;
    padding:14px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:16px;
}

.search-area input:focus{
    outline:none;
    border-color:#1565c0;
}

/* Buttons */
button{
    padding:14px 18px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    background:#1565c0;
    color:white;
    font-size:15px;
    transition:.3s;
}

button:hover{
    background:#0d47a1;
    transform:translateY(-2px);
}

/* Loading */
#loading{
    display:none;
    text-align:center;
    margin:20px;
}

.spinner{
    width:45px;
    height:45px;
    margin:auto;
    border:5px solid #ddd;
    border-top:5px solid #1565c0;
    border-radius:50%;
    animation:spin 1s linear infinite;
}

@keyframes spin{
    from{
        transform:rotate(0deg);
    }
    to{
        transform:rotate(360deg);
    }
}

/* Country Card */
.card{
    background:white;
    border-radius:15px;
    padding:25px;
    margin-top:20px;
    box-shadow:0 5px 20px rgba(0,0,0,.1);
    animation:fade .5s;
}

body.dark .card{
    background:#1f1f1f;
}

@keyframes fade{
    from{
        opacity:0;
        transform:translateY(15px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* Flag */
.flag{
    width:180px;
    display:block;
    margin:auto;
    border-radius:8px;
    margin-bottom:20px;
}

/* Coat of Arms */
.coat{
    width:120px;
    display:block;
    margin:20px auto;
}

/* Titles */
.card h2{
    text-align:center;
    margin-bottom:15px;
    color:#1565c0;
}

.card p{
    margin:10px 0;
}

/* Links */
.card a{
    color:#1565c0;
    text-decoration:none;
}

.card a:hover{
    text-decoration:underline;
}

/* Weather Card */
#weatherCard{
    margin-top:25px;
    background:white;
    border-radius:15px;
    padding:20px;
    box-shadow:0 5px 20px rgba(0,0,0,.1);
}

body.dark #weatherCard{
    background:#1f1f1f;
}

/* Interactive Map */
#map{
    margin-top:25px;
    height:420px;
    border-radius:15px;
    overflow:hidden;
}

/* History & Favorites */
.history,
.favorites{
    margin-top:35px;
}

.history h2,
.favorites h2{
    margin-bottom:12px;
    color:#1565c0;
}

.history ul,
.favorites ul{
    list-style:none;
}

.history li,
.favorites li{
    background:#ffffff;
    margin-bottom:10px;
    padding:12px;
    border-radius:8px;
    cursor:pointer;
    transition:.3s;
}

.history li:hover,
.favorites li:hover{
    background:#e3f2fd;
}

body.dark .history li,
body.dark .favorites li{
    background:#222;
}

/* Footer */
footer{
    margin-top:40px;
    padding:25px;
    text-align:center;
    background:#1565c0;
    color:white;
}

footer p{
    margin:5px 0;
}

/* Mobile */
@media(max-width:768px){

.search-area{
    flex-direction:column;
}

.search-area input,
button{
    width:100%;
}

.flag{
    width:140px;
}

#map{
    height:300px;
}

header h1{
    font-size:1.6rem;
}

}
