:root {
    --main-color: #213e4d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body & General Stuff */
body {
    background-color: #fbfbfb;
    font-family: 'Nanum Gothic', sans-serif;
    font-size: 16px;
    color: #1a252e;
}
.dash-page {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100vh;
    flex-direction: column;
}

a, a:hover, button, button:hover, li, li:hover { transition: all 0.5s ease-in-out; }

/* Header */
header {
    width: 100%;
    padding: 50px;
    text-align: center;
    font-size: 1.5em;
    background-color: #132832;
    background-image: linear-gradient(#213e4d, #132832);
    color: #fbfbfb;
    position: relative;
}
header h1 {
    font-weight: 400;
}
header .unit-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}
header .unit-toggle .unit-button {
    padding: 10px;
    border-radius: 20px;
    position: relative;
    border: 0;
    background-color: #dee1e3;
    color: var(--main-color);
    font-weight: 700;
}
header .unit-toggle .unit-button:hover {
    cursor: pointer;
}
header .unit-toggle .unit-button span {
    padding: 0 5px;
    font-size: 1.2em;
}
header .unit-toggle .unit-button .toggle-bulb, header .unit-toggle .fahrenheit .toggle-bulb {
    width: 28px; height: 28px;
    border-radius: 50%;
    background-color: var(--main-color);
    position: absolute;
    top: 0;
    left: 0;
    margin: 5px;
    transition: all 0.5s ease-in-out;
}
header .unit-toggle .celsius .toggle-bulb {
    left: calc(100% - 38px);
}

/* Main Body */
main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 1380px;
    max-width: 100%;
    margin: 0 auto;
    flex: auto;
}
h2, h3, h4 {
    color: var(--main-color);
}
a {
    color: #005c66;
    text-decoration: none;
}
a:hover{
    color: var(--main-color);
}
ul {
    list-style: none;
}
.error {
    padding: 10px;
    border: 5px solid #9b1b30;
    background-color: #a83d4e;
    color: #f2f4f5;
}

/* Load Icon */
.loading {
    border: 8px solid #dee1e3;
    border-top-color: var(--main-color);
    border-radius: 50%;
    width: 40px; height: 40px;
    animation: load 1s linear infinite;
    margin: 0 auto;
}
@keyframes load {
	0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Left Side - City Search */
main .cities {
    width: 30%;
    padding: 20px;
}
main .cities h3 {
    margin: 5px;
}
main .cities input, main .cities button {
    width: calc(100% - 10px);
    padding: 10px;
    margin: 5px;
    font-size: 0.9em;
}
main .cities p {
    font-size: .8em;
    padding: 5px;
    font-style: italic;
    margin: 0 5px;
}
main .cities input {
    background-color: #ffffff;
    border: 1px solid #dee1e3;
    color: var(--main-color);
    font-family: 'Nanum Gothic', sans-serif;
}
main .cities input:focus {
    outline: 1px solid #dee1e3;
}
main .cities button {
    border: 0;
    background-color: var(--main-color);
    color: #fbfbfb;
    font-family: 'Nanum Gothic', sans-serif;
}
main .cities button:hover {
    cursor: pointer;
}

/* Left Side - Search History */
main .cities .search-history {
    border-top: 2px solid #dee1e3;
    margin: 10px 0 0 0;
}
main .cities .search-history ul { 
    margin: 10px 0 0 0;
}
main .cities .search-history li {
    margin: 2px 0;
    text-align: center;
    position: relative;
}
main .cities .search-history .recent-button {
    display: block;
    padding: 10px;
    width: 100%;
    background-color: #dee1e3;
    color: var(--main-color);
    text-decoration: none;
    margin: 0;
    font-size: 1em;
    font-family: 'Nanum Gothic', sans-serif;
}
main .cities .search-history .recent-button:hover {
    background-color: #e4e9eb;
    color: #1a252e;
}
main .cities .search-history .delete-button {
    position: absolute;
    width: 28px;
    top: 0;
    right: 0;
    border-radius: 50%;
    padding: 5px;
    font-size: 1em;
    transform: rotate(0deg) scale(0);
    opacity: 0;
    background-color: transparent;
    color: var(--main-color);
}
main .cities .search-history .delete-button:hover {
    background-color: var(--main-color);
    color: #fbfbfb;
}
main .cities .search-history li:hover .delete-button {
    transform: rotate(180deg) scale(1);
    opacity: 1;
}

/* Right Side - Weather Display */
main .weather {
    width: 70%;
    padding: 20px;
}

main .current-info {
    background-color: #f2f4f5;
    border: 1px solid #dee1e3;
    padding: 20px;
}
main .current-info h2 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
}
main .current-info h2 span.city-name {
    margin: 0 15px 0 0;
}
main .current-info h2 span.date-time {
    font-size: 0.65em;
    padding: 8px;
    background-color: var(--main-color);
    color: #f2f4f5;
    font-weight: 400;
}
main .current-info h2 img {
    height: 37px;
    margin-left: 10px;
}
main .current-info li {
    padding: 10px 0;
}

main .forecast h3 {
    margin: 15px 5px 5px;
}

main .weather-info {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
}
main .weather-info .data-list {
    margin-right: 50px;
}
main .weather-info .weather-icon img {
    max-width: 100%;
    max-height: 150px;
}

main .weather .similar-results {
    margin-bottom: 10px;
}
main .weather .similar-results button {
    background-color: #dee1e3;
    color: var(--main-color);
    border: 0;
    padding: 10px;
    margin: 2px 5px 0 0;
}
main .weather .similar-results button:hover {
    cursor: pointer;
    background-color: #e4e9eb;
}

/* Right Side - 5-Day Forecast */
main .week {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}
main .day {
    width: calc(20% - 10px);
    background-color: var(--main-color);
    color: #fbfbfb;
    padding: 15px;
    margin: 5px;
    font-size: 0.88em;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
}
main .day h4 {
    color: #ffffff;
    margin: 0 0 10px 0;
    font-size: 1.2em;
    width: 100%;
}
main .day p {
    margin: 10px 0 0 0;
    width: 100%;
}
main .day .daily-info, main .day .daily-icon {
    width: 100%;
}
main .day .daily-icon img {
    width: 100%;
}

.hidden .current-info, .hidden .forecast {
    display: none;
}

/* UV Index Colors */
.uv {
    display: inline-block;
    padding: 6px 8px;
    border-radius: 5px;
    color: #ffffff;
    font-size: 0.9em;
    margin: -5px 2px;
}
.uv-green {
    background-color: #1e784d;
}
.uv-yellow {
    background-color: #f9d67a;
    color: #1a252e;
}
.uv-orange {
    background-color: #eb6e4b;
}
.uv-red {
    background-color: #9b1b30;
}
.uv-violet {
    background-color: #7b4f9a;
}

/* Footer*/
footer {
    width: 100%;
    padding: 20px 50px;
    align-self: end;
    text-align: center;
}
footer ul.credits li {
    margin: 2px 0;
}

/* RESPONSIVE -------------------------------------------------------------------------- */
/* 1024 */
@media screen and (max-width: 1024px) {
    main .cities .search-history {
        font-size: 0.9em;
    }
    main .cities .search-history .delete-button {
        width: 26px;
    }
    main .day {
        width: calc(33% - 10px);
    }
    footer {
        padding: 20px;
        text-align: left;
    }
}

/* 600 */
@media screen and (max-width: 600px) {
    main .cities, main .weather {
        width: 100%;
    }
    main .current-info h2 {
        text-align: center;
    }
    main .current-info h2 span {
        display: block;
        width: 100%;
    }
    main .current-info h2 span.city-name {
        margin: 0 0 10px 0;
        flex: 1;
    }
    main .current-info h2 span.date-time {
        order: 3;
    }
    main .current-info h2 img {
        order: 2;
        height: 34px;
    }
    main .day {
        width: 100%;
    }
    main .day .daily-info {
        width: 70%;
    }
    main .day .daily-icon {
        width: 30%;
        order: 2;
    }
    main .cities .search-history ul li:nth-child(1n+6) {
        display: none; 
    }
}

/* 400 */
@media screen and (max-width: 400px) {
    header {
        padding: 30px;
        font-size: 1.3em;
    }
    header .unit-toggle .unit-button {
        padding: 6px;
        border-radius: 18px;
    }
    header .unit-toggle .unit-button span {
        padding: 0 3px;
        font-size: 1em;
    }
    header .unit-toggle .unit-button .toggle-bulb, header .unit-toggle .fahrenheit .toggle-bulb {
        width: 20px; height: 20px;
        margin: 4px;
    }
    header .unit-toggle .celsius .toggle-bulb {
        left: calc(100% - 28px);
    }
    main .weather-info .data-list {
        margin-right: 30px;
    }
    main .weather-info .weather-icon img {
        max-height: 130px;
    }
    main .current-info h2 span.city-name {
        flex: 100%;
    }
    main .current-info h2 img {
        display: none;
    }
}

/* 270 */
@media screen and (max-width: 270px) {
    main .weather-info .data-list {
        margin-right: 0;
        width: 100%;
        order: 2;
    }
    main .weather-info .weather-icon {
        width: 100%;
        text-align: center;
    }
    main .weather-info .weather-icon img {
        max-height: initial;
    }
    main .day .daily-info {
        width: 100%;
        order: 2;
    }
    main .day .daily-icon {
        width: 100%;
        order: 1;
    }
}