* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 120, 0.4) transparent;
}

body {
    margin: 0 auto;
    background: no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    text-shadow: 0px 0px 20px #242424;
}

main {
    padding: 15px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

div.top {
    display: flex;
    justify-content: space-between;
}

h1.time {
    text-align: center;
    margin: 0;
    font-size: 1.8rem;
    line-height: 1;
}

div#crypto {
    font-size: 1rem;
    background: rgba(40, 40, 40, 0.8);
    padding: 0.8rem;
    border-radius: 1em;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

div#crypto>p {
    margin: 0;
    font-size: 0.9rem;
}

div#crypto-top {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

div#crypto-top>span {
    margin-left: 8px;
    font-size: 1rem;
    font-weight: bold;
}

div#crypto-top img {
    width: 24px;
    height: auto;
}

#crypto-selector {
    margin-top: 10px;
    display: block !important;
}

.search-crypto-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    display: block !important;
}

.crypto-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

#crypto-search {
    width: 100%;
    padding: 8px 30px 8px 10px;
    background: rgba(32, 33, 36, 0.8);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    text-shadow: none;
    display: block !important;
}

#crypto-search:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

#crypto-search::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.crypto-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.crypto-search-icon:hover {
    color: white;
}

.crypto-dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(32, 33, 36, 0.95);
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    border-radius: 0 0 24px 24px;
    z-index: 1000;
    margin-top: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    color: white;
    animation: fadeIn 0.2s ease-out;
}

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

.crypto-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.crypto-dropdown-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.crypto-option-header {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.crypto-search-label {
    display: flex;
    align-items: center;
}

.crypto-search-label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(255,255,255,0.7)"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.crypto-not-found {
    display: none;
    background-color: rgba(32, 33, 36, 0.95);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    margin-top: 5px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-shadow: none;
    width: 100%;
    position: absolute;
    z-index: 1000;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(120, 120, 120, 0.4);
    border-radius: 10px;
}

.hide-scrollbar {
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.crypto-dropdown-content.show {
    display: block;
}

.crypto-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.crypto-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.crypto-option:last-child {
    margin-bottom: 4px;
}

.crypto-option .crypto-image {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
    object-fit: cover;
}

.crypto-option-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    line-height: 1.3;
}

.crypto-name {
    color: white;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crypto-symbol {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.crypto-name strong, .crypto-symbol strong {
    color: #8ab4f8;
    font-weight: normal;
}

.crypto-loading {
    padding: 12px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.crypto-chart {
    margin-top: 10px;
    height: 50px;
    width: 100%;
    background: rgba(32, 33, 36, 0.5);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.chart-container {
    width: 100%;
    height: 100%;
}

.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.weather-time-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 200px;
}

.datetime-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
}

p.date {
    margin: 2px 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

p.date .weekday {
    font-weight: bold;
    margin-bottom: 2px;
}

div#weather {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    width: 100%;
    background: rgba(64, 64, 64, 0.4);
    padding: 0.5em;
    border-radius: 1em;
}

div#weather>img {
    width: 52px;
    margin: 0 auto 5px;
    display: block;
}

.weather-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

p.weather-temp {
    margin: 0;
    font-size: 24px;
    text-align: center;
}

p.weather-city {
    width: 100%;
    text-align: center;
    margin: 0;
    font-size: 18px;
}

.weather-forecast {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

.forecast-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 5px 0;
}

.forecast-day-abbrev {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.forecast-icon {
    font-size: 18px;
    margin: 5px 0;
}

.forecast-temp {
    font-size: 14px;
}

@media (max-width: 520px) {
    .forecast-day-abbrev {
        font-size: 12px;
    }
    .forecast-icon {
        font-size: 16px;
    }
    .forecast-temp {
        font-size: 12px;
    }
}

.search-container {
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#search-form {
    width: 100%;
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    background: rgba(60, 60, 60, 0.7);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-engine-selector {
    position: relative;
    z-index: 1002;
}

.current-engine {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background-color: transparent;
    min-height: 46px;
}

.current-engine:hover {
    background-color: rgba(80, 80, 80, 0.8);
}

.current-engine img {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.engine-text {
    margin-right: 5px;
    color: white;
}

.engine-arrow {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 5px;
}

.search-engines-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: rgba(60, 60, 60, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1002;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.search-engines-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-engines-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-engines-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-engine-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.search-engine-option:last-child {
    border-bottom: none;
}

.search-engine-option:hover {
    background: rgba(80, 80, 80, 0.8);
}

.search-engine-option img {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.search-engine-option span {
    color: white;
}

.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: rgba(60, 60, 60, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(5px);
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: rgba(80, 80, 80, 0.8);
}

.suggestion-item strong {
    color: #8ab4f8;
    font-weight: normal;
}

#search-input {
    flex-grow: 1;
    padding: 12px 20px;
    font-size: 1.2rem;
    border: none;
    background: transparent;
    color: white;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search-input:focus {
    outline: none;
}

#search-button {
    padding: 12px 25px;
    background: rgba(80, 80, 80, 0.7);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

#search-button:hover {
    background: rgba(100, 100, 100, 0.9);
}

.bookmarks-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
    width: 100%;
}

.bookmark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(64, 64, 64, 0.4);
    border-radius: 12px;
    padding: 10px 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    height: 60px;
}

.bookmark-item:hover {
    background: rgba(80, 80, 80, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bookmark-icon {
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.bookmark-name {
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.9);
}

.bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.buttons-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#author {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.icon-button {
    background: rgba(64, 64, 64, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
}

.icon-button:hover {
    background: rgba(80, 80, 80, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.icon-button .tooltip {
    visibility: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    width: max-content;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    pointer-events: none;
}

.icon-button:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.icon-button .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background-color: rgba(40, 40, 40, 0.95);
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    color: white;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ccc;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.setting-option {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.setting-option label {
    min-width: 120px;
    margin-right: 10px;
}

.setting-option select,
.setting-option input[type="text"] {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: white;
    width: 200px;
}

.setting-option button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 10px;
}

.setting-option button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.location-input {
    display: none;
    margin-top: 10px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.settings-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.settings-button.save {
    background: rgba(0, 122, 255, 0.7);
    padding: 10px 20px;
}

.settings-button.save:hover {
    background: rgba(0, 122, 255, 0.9);
}

.setting-option select {
    background-color: rgba(60, 60, 60, 0.9);
    color: white;
    width: auto;
    min-width: 140px;
    max-width: 100%;
}

.setting-option select option {
    background-color: #333;
    color: white;
}

@media (max-width: 1080px) {
    p.weather-city,
    p.weather-temp,
    div #crypto {
        font-size: 1rem;
    }
    
    .bookmarks-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    h1.time {
        font-size: 1.5rem;
    }
}

@media (max-width:852px) {
    main {
        justify-content: space-evenly;
    }
    
    div.top {
        flex-direction: column-reverse;
        align-items: center;
        gap: 15px;
    }
    
    .weather-time-container {
        max-width: 100%;
        align-items: center;
        margin-bottom: 10px;
    }

    #weather {
        min-width: 200px;
    }
    
    div#crypto {
        max-width: 100%;
        width: 300px;
    }
    
    .bookmarks-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width:600px) {
    .bookmarks-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .bookmark-item {
        height: 55px;
    }
    
    .search-container {
        width: 95%;
    }
    
    .bottom-container {
        flex-direction: column-reverse;
        gap: 10px;
        align-items: flex-end;
    }
    
    #author {
        align-self: flex-start;
    }
    
    div#crypto {
        width: 100%;
    }
}

@media (max-width:480px) {
    .bookmarks-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    #search-form {
        flex-wrap: wrap;
    }
    
    .search-engine-selector {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .current-engine {
        border-right: none;
        justify-content: center;
    }
    
    #search-input {
        width: 70%;
    }
    
    #search-button {
        width: 30%;
        padding: 12px 10px;
    }
}