@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,500;0,600&display=swap');

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

:root {
    --bg-color: -webkit-linear-gradient(left, #a445b2, #fa4299, #a445b2);
    --bg-note: white;
    --text-color: black;
    --title-color: #392342;
    --link-color: #FA4299;
    --border-color: #FC83BB;
    --highlight-color: #cacaca;
    --switch-bg-url: url(../assets/sun.svg);
}
    
.dark {
    --bg-color: -webkit-linear-gradient(left, #111214, #53235e, #111214);
    --bg-note: rgb(233, 233, 233);
    --text-color: white;
    --title-color: rgb(223, 220, 220);
    --link-color: #53235e;
    --border-color: #a27aff;    
    --switch-bg-url: url(../assets/moon-stars.svg);
}

::selection{
    color: white;
    background: #b362d3;
}

html, body {
    display: grid;
    height: 100%;
    width: 100%;
    background: var(--bg-color);
}

/* Login */
body.login {    
    place-items: center;        
}

.main {
    overflow: hidden;
    max-width: 24.5em;
    background: white;
    padding: 30px;
    margin: 10px;
    border-radius: 5px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
}

.main .title-text {
    display: flex;
    width: 200%;
}

.main .title {
    width: 50%;
    font-size: 35px;
    font-weight: 600;
    text-align: center;    
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.main .slide-controls {
    position: relative;
    display: flex;
    height: 50px;
    width: 100%;
    overflow: hidden;
    margin: 30px 0 10px 0;
    justify-content: space-between;
    border: 1px solid lightgray;
    border-radius: 5px;
}

.slide-controls .slide {
    height: 100%;
    width: 100%;
    z-index: 1;
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    line-height: 48px;
    cursor: pointer;
    transition: all 0.6s ease;
}

.slide-controls label.signup {
    color: black;
}

.slide-controls .slide-tab {
    position: absolute;
    height: 100%;
    width: 50%;
    left: 0;
    z-index: 0;
    border-radius: 2px;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: var(--bg-color);
}

input[type="radio"] {
    display: none;
}

#signup:checked ~ .slide-tab {
    left: 50%;
}

#signup:checked ~ .signup {
    color: white;
}

#signup:checked ~ .login {
    color: black;
}

.main .form-container {
    width: 100%;
    overflow: hidden;
}

.form-container .form-inner {
    display: flex;
    width: 200%;
}

.form-container .form-inner form {
    width: 50%;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.main .form-inner form .field {
    height: 50px;
    width: 100%;
    margin-top: 20px;
}

.form-inner form .field input {
    height: 100%;
    width: 100%;
    outline: none;
    padding-left: 15px;
    font-size: 17px;
    border-radius: 5px;
    border: 1px solid lightgray;
    border-bottom-width: 2px;
    transition: all 0.4s ease;
}

.form-inner form .field input:focus {
    border-color: var(--border-color);
}

.form-inner form .pass-link {
    margin-top: 5px;
}

.form-inner form .pass-link a,
.form-inner form .signup-link a {
    color: var(--link-color);
    text-decoration: none;
}

.form-inner form .signup-link {
    text-align: center;
    margin-top: 30px;
}

.form-inner form .pass-link a:hover,
.form-inner form .signup-link a:hover {
    text-decoration: underline;
}

form .field input[type="submit"] {
    color: white;
    font-size: 20px;
    font-weight: 500;
    padding-left: 0;
    border: none;
    cursor: pointer;
    background: var(--bg-color);
}

/* Index */
.wrapper {
    margin: 50px;
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fill, 17.5em);
}

.wrapper li {
    height: 250px;
    list-style: none;
    background: var(--bg-note);
    border-radius: 5px;
    padding: 15px 20px 20px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
}

.add-box, .icon, .bottom-content,
.settings .menu li, .popup, header {
    display: flex;
    align-items: center;
    justify-content: space-between;    
}

.add-box {
    flex-direction: column;
    justify-content: center;    
    cursor: pointer;    
}

.add-box .icon{
    height: 2em;
    width: 2em;
    color: #855499;
    font-size: 40px;
    border-radius: 50%;
    justify-content: center;
    border: 2px dashed #855499;
  }

.add-box p {
    color: #855499;
    font-weight: 500;
    margin-top: 20px;
}

li.add-box, li.note {    
    height: 24.5em;    
}

.note {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.note .details {
    max-height: 19em;
    overflow-y: auto;
}

.note p {
    min-height: 2em;
    font-size: 22px;
    font-weight: 500;
}

.note span {
    display: block;
    max-height: 17em;
    margin-top: 5px;
    font-size: 16px;
    color: #575757;
}

::-webkit-scrollbar {
    width: 8px; /* largura da barra de rolagem */
}

::-webkit-scrollbar-track {
    background: var(--link-color); /* cor da trilha da barra */
}

::-webkit-scrollbar-thumb {
    background: var(--border-color); /* cor do botão de rolagem */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-color); /* cor do botão de rolagem quando hover */
}

.note .bottom-content {
    padding-top: 10px;
    border-top: 1px solid lightgray;
}

.bottom-content span {
    color: #6d6d6d;
    font-size: 14px;
}

.bottom-content .settings {
    position: relative;
}

.bottom-content .settings i {
    color: #6d6d6d;
    font-size: 15px;
    cursor: pointer;
}

.settings .menu {
    position: absolute;
    bottom: 0;
    right: -5px;
    padding: 5px 0;
    background: white;
    border-radius: 4px;
    transform: scale(0);
    transform-origin: bottom right;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
    z-index: 1;
}

.settings:hover .menu {
    transform: scale(1);
}

.settings .menu li{
    height: 25px;
    font-size: 16px;
    margin-bottom: 2px;
    padding: 17px 15px;
    cursor: pointer;
    box-shadow: none;
    border-radius: 0;    
    justify-content: flex-start;
}

.menu li:last-child{
    margin-bottom: 0;
}

.menu li:hover {
    background: var(--highlight-color);
}

.menu li i {
    padding-right: 8px;
}

.popup-box {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.popup-box.show {
    opacity: 1;
    pointer-events: auto;
}

.popup-box .popup {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    max-width: 25em;
    width: 100%;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.popup-box.show .popup {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.popup .content {
    width: calc(100% - 15px);
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.content header {
    padding: 15px 25px;
    border-bottom: 1px solid #cccccc;
}

.content header p {
    font-size: 20px;
    font-weight: 500;
}

.content header i {
    color: #8b8989;
    cursor: pointer;
    font-size: 23px;
}

.content form {
    margin: 15px 25px 35px;
}

.content form .row {
    margin-bottom: 20px;
}

form .row label {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
}

form :where(input, textarea) {
    width: 100%;
    height: 2.5em;
    outline: none;
    font-size: 17px;
    padding: 0 15px;
    border-radius: 5px;
    border: 1px solid lightgray;
    border-bottom-width: 2px;
    transition: all 0.4s ease;
}

form :where(input, textarea):focus{
    border-color: var(--border-color);
}

form .row textarea {
    height: 10em;
    resize: none;
    padding: 8px 15px;
}

.content form button {
    width: 100%;
    height: 50px;
    border: none;
    outline: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 17px;
    border-radius: 4px;
    background: var(--bg-color);
}

/* Navbar */
.nav {
    height: 10px;
}
.nav h1 {
    position: fixed;
    top: 0.5em;
    left: 3.5em;
    color: var(--text-color);
}

.nav #user-name {
    padding: 10px;
    position: fixed;
    top: 1.15em;
    right: 7em;
    font-size: 17px;
    font-weight: 600;
    color: var(--title-color);  
}

.nav #user-name:hover {
    color: var(--border-color);
    cursor: pointer;
}

.logout {
    position: fixed;
    top: 1.5em;
    right: 1.5em;
}

.logout #logout-btn {
    width: 80px;
    height: 40px;
    border: none;
    outline: none;
    color: white;
    cursor: pointer;
    font-size: 17px;
    border-radius: 4px;
    background: var(--border-color);
}

.logout #logout-btn:hover {
    background: var(--link-color);
}

.switch-container {
    position: fixed;
    top: 0.5em;
    left: 1em;
}

#switch {
    position: relative;
    width: 64px;
    margin: 4px auto;
}
  
#switch button {
    width: 32px;
    height: 32px;
    background: white var(--switch-bg-url) no-repeat center;
    border: 0;
    border-radius: 50%;  
    position: absolute;
    z-index: 1;
    left: 0;
    transform: translateY(-50%);
    top: 50%;  
    animation: slide-back 0.2s;
}
  
.dark #switch button {
    animation: slide-in 0.2s forwards;
}

#switch button:hover {
    cursor: pointer;
}

#switch span {
    margin-top: 18px;
    display: block;
    width: 64px;
    height: 24px;
    background: var(--border-color);
    border: 1px solid var(--link-color);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 9999px;
}

/* Spinner */
.loading {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

    @keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
} 

/* Animation */
@keyframes slide-in {
    from {left: 0;}
    to {left: 50%;}
}
  
@keyframes slide-back {
    from {left: 50%;}
    to {left: 0;}
}

/* Media */
@media (max-width: 539px){
    #user-name {
        display: none;
    }

    .nav h1 {
        left: 3em;
    }
}