html,
body {
    margin: 0;
    min-height: 100vh;
}

body {
    background:
        radial-gradient(circle at bottom left,
            #3E466A 0%,
            transparent 35%),
        linear-gradient(to left,
            #0D1326 0%,
            #23283E 45%,
            #9CA1C5 100%);
    font-family: "Poppins", sans-serif;
}

/* ====================
   Layout
==================== */
.container {
    position: relative;
    max-width: 760px;
    min-height: calc(100vh - 120px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    margin: 10px auto;
    padding: 10px;

    background: #151932;
    border: 1px solid #71748B;
    border-radius: 15px;

    transition:
        max-width .45s ease,
        min-height .45s ease,
        margin .45s ease,
        padding .45s ease;
}

.container.selected {
    max-width: 900px;
    min-height: fit-content;
    padding-top: 10px;
    margin: 5px auto;
}

header {
    text-align: center;
    margin-bottom: 15px;
}

header h1 {
    margin-bottom: 10px;
    font-size: 35px;
    color: white;
}

header p {
    margin-bottom: 10px;
    color: #DADDEC;
    font-size: 15px;
    font-weight: 300;
}

.clock {
    width: 40px;
    vertical-align: middle;
    border-radius: 25px;
}

.world-map {
    position: absolute;
    top: 50px;
    right: 10px;
    width: 280px;
    pointer-events: none;
}

.layout {
    display: grid;
    grid-template-columns: 1.5fr 0.7fr;
    gap: 30px;
    align-items: start;
    transition: grid-template-columns 0.3s ease;
}

.layout.selected {
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}

/* ====================
   City Cards
==================== */
.cities {
    display: flex;
    flex-direction: column;
}

.city {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr;
    align-items: center;
    background: #191F32;
    border: 1px solid #262C3F;
    border-radius: 20px;
    color: white;
    padding: 10px 22px;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.city:hover {
    transform: translateY(-3px);
    border-color: #6D61D6;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .35);
}

.city:first-child {
    background: #24254A;
    border: 1px solid #423D6E;
}

h2 {
    display: flex;
    justify-content: space-between;
    margin: 0;
    font-size: 22px;
}

.city-info h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 500;
}

.country {
    margin: 0;
    font-size: 15px;
    color: #B4B5CA;
}

.city-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.city-date p {
    margin: 0;
    font-size: 17px;
    color: #B4B5CA;
}

.date {
    color: #B4B5CA;
    font-size: 17px;
}

.city-time {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 14px;
}

.time {
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.period {
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
    color: #AE98F0;
}

.difference {
    margin: 0;
    font-size: 15px;
    color: #777;
    position: relative;
    top: -8px;
    width: 100%;
    text-align: center;
}

/* ====================
   Sidebar
==================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-box-title {
    color: #7B6CF6;
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #7B6CF6,
        0 0 10px #7B6CF6,
        0 0 20px #7B6CF6;
    text-align: center;
    margin: 0 auto 10px
}

.search-box {
    background: #191F32;
    border: 1px solid #2E3448;
    border-radius: 18px;
    padding: 20px;
}

select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
    background: #151932;
    color: white;
    border: 1px solid #343A55;
    transition: .25s;
}

select:hover {
    border-color: #7B6CF6;
}

select:focus {
    outline: none;
    border-color: #8D79E8;
    box-shadow: 0 0 0 3px rgba(141, 121, 232, .25);
}

.selected-city {
    display: none;
    background: #24254A;
    border: 1px solid #423D6E;
    border-radius: 18px;
    padding: 7px;
    color: white;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(15px);
    transition: all .35s ease;
}

.selected-city.show {
    opacity: 1;
    transform: translateY(0);
}

.selected-name {
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #7B6CF6,
        0 0 10px #7B6CF6,
        0 0 20px #7B6CF6;
}

.selected-city h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.selected-country {
    margin: 6px 0 12px;
    color: #B5B7D6;
    font-size: 15px;
}

.selected-time {
    display: block;
    font-size: 26px;
    font-weight: 700;
}

.selected-date-row {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    color: #B5B7D6;
    font-size: 15px;
}

.selected-date,
.selected-day {
    margin-top: 10px;
    color: #B5B7D6;
    font-size: 15px;
}

.time-comparison {
    display: none;
    margin-top: 5px;
    background: #191F32;
    border: 1px solid #2E3448;
    border-radius: 18px;
    padding: 10px;
    padding-bottom: 12px;
    color: white;
    opacity: 0;
    transform: translateY(15px);
    transition: all .45s ease;
}

.time-comparison.show {
    opacity: 1;
    transform: translateY(0);
}

.ahead-text {
    color: #49D17D;
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #49D17D,
        0 0 10px #49D17D,
        0 0 20px #49D17D;
    font-weight: 600;
}

.behind-text {
    color: #F46B6B;
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #F46B6B,
        0 0 10px #F46B6B,
        0 0 20px #F46B6B;
    font-weight: 600;
}

.comparison-item .current-period {
    font-size: 10px;
    display: inline;

}

.comparison-text {
    margin: 8px 0 12px;
    color: #B5B7D6;
    font-size: 14px;
    line-height: 1.5;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.comparison-item {
    background: #24254A;
    border-radius: 14px;
    padding: 15px;
    text-align: center;
}

.comparison-item span {
    display: block;
    color: #AEB2D6;
    font-size: 13px;

    margin-bottom: 10px;
}

.comparison-item strong {
    font-size: 24px;
    font-weight: 700;
}

.selected-city-label {
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #7B6CF6,
        0 0 10px #7B6CF6,
        0 0 20px #7B6CF6;
}

/* ====================
   Compact Mode
==================== */
.compact {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px 20px;
}

.compact .city-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compact .city-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.compact .city-date,
.compact .city-time {
    display: contents;
}

.compact .city-info h2 {
    font-size: 18px;
    margin-bottom: 3px;
}

.compact .country {
    font-size: 13px;
}

.compact .time {
    font-size: 18px;
}

.compact .date,
.compact .day {
    font-size: 13px;
}

.compact .day {
    margin: 5px auto;
}

.compact .difference {
    font-size: 12px;
    margin: 0;
}

.difference.ahead {
    color: #49D17D;
    font-weight: 600;
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #49D17D,
        0 0 10px #49D17D,
        0 0 20px #49D17D;
}

.difference.behind {
    color: #F46B6B;
    font-weight: 600;
    text-shadow:
        -1px 0 0 #000,
        0 0 5px #F46B6B,
        0 0 10px #F46B6B,
        0 0 20px #F46B6B;
}

.difference.same {
    color: #B5B7D6;
    font-weight: 600;
}

/* ====================
   Footer
==================== */
footer {
    text-align: center;
    color: #B5BACC;
    margin: 15px 0;
    font-size: 15px;
}

footer a {
    color: #AE98F0;
}