:root{
    color-scheme: dark;
    --main-bg-color: #20201F;
    --surface-color: #292927;
    --elevated-surface-color: #333330;

    --primary-red:#E02020;
    --bright-red:#F03030;
    --dark-red:#8F1515;

    --main-text-color: #F0F0E8;
    --secondary-text-color: #B8B8B2;
    --border-color: #41413D;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body{
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    font-family: 'Roboto', sans-serif;
}

#app:has(> #login-view){
    min-height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 10%;
}

#login-view{
    width:100%;
    max-width: 400px;
    min-width: 224px;

    padding: 1.75rem;

    background-color: var(--surface-color);
    /* border: 1px solid var(--border-color); */
    border-radius: 10px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    /* margin-right: 10%; */
}

#login-view h1{
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03rem;
    margin-bottom: 2rem;
}

#login-form{
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#login-form label{
    font-size: 1rem;
    color: var(--secondary-text-color);
    
}

/* Inputs styling */
#login-form input{
    width: 100%;
    padding: 0.8rem 1rem;

    border: 1px solid var(--border-color);
    border-radius: 6px;
    
    background-color: var(--elevated-surface-color);
    color: var(--main-text-color);
    font-size: 1rem;

    transition: border-color 150ms ease, 
                box-shadow 150ms ease;
}

#login-form input::placeholder{
    color: var(--secondary-text-color);
    opacity: 0.7;
}

#login-form input:focus{
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(224, 32, 32, 0.15);
}


/* Button styling */
#login-form button{
    align-self: center;
    width: 50%;

    margin-top: 1rem;
    padding: 0.8rem 1rem;

    border: none;
    border-radius: 6px;

    background-color: var(--primary-red);
    color: var(--main-text-color);

    font:inherit;
    font-size: 1.25rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 150ms ease,
                transform 100ms ease;
}
#login-form button:hover{
    background-color: var(--bright-red);
}
#login-form button:active{
    background-color: var(--dark-red);
    transform: scale(0.98);
}

#login-form button:focus-visible {
    outline: 2px solid var(--bright-red);
    outline-offset: 1px;
}

/* error message styling */
#login-errors{
    margin-top: 1rem;
    padding: 0.75rem 1rem;

    border: 1px solid var(--dark-red);
    border-radius: 6px;

    background-color: rgba(143, 21, 21, 0.15);
    color: var(--bright-red);

    font-size: 0.9rem;
}


/* ==========================
            PROFILE
   ========================== */

#app:has(> main){
    min-height: 100vh;
}

main{
    width: min(90%, 1200px);
    margin: 0 auto;
}

nav{
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

#title h1{
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03rem;
}

#title p{
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

#logout{
    padding: 0.6rem 1.2rem;

    background-color: transparent;
    color: var(--secondary-text-color);

    border: 1px solid var(--border-color);
    border-radius: 6px;

    font: inherit;
    cursor: pointer;

    transition: background-color 150ms ease, 
                color 150ms ease,
                border-color 150ms ease;
}

#logout:hover{
    color: var(--main-text-color);
    background-color: rgba(224, 32, 32, 0.08);
    border-color: var(--primary-red);
}

#user-info{
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    margin-top: 2rem;
    padding: 2rem;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.user-profile{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.user-avatar{
    width: 160px;
    height: 160px;

    perspective: 1000px;
}

.user-avatar img{
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);

    object-fit: cover;

    border-radius: 50%;

    border: 3px solid var(--border-color);

    filter:grayscale(100%);

    transition: transform 0.7s ease,
                filter 0.4s ease,
                border-color 0.4s ease;
    transform-style: preserve-3d;
}

.user-avatar:hover img{
    transform: rotateY(0deg);
    filter:grayscale(0%)
            sepia(10%)
            saturate(110%);
    border-color: var(--primary-red);
}

.user-identifier{
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name{
    margin:0;

    display: flex;
    gap: .4rem;
    font-size: 2rem;
    font-weight: 600;

    color:var(--main-text-color);
}

.user-login{
    margin: 0;

    color: var(--secondary-text-color);
    font-size: .95rem;
}

.user-stats{
    width: 100%;
    max-width: 400px;

    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.user-stat{
    flex:1;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: .75rem 1.5rem;

}

.user-stat + .user-stat{
    border-left: 1px solid var(--border-color);
}

.stat-label{
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--secondary-text-color);
}

.stat-value{
    margin-top: .25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--main-text-color);
    text-shadow: 0 0 2px var(--primary-red);
}



.user-details{
    display: flex;
    justify-content: center;
    gap: 1.5rem;

    margin-top: 1.5rem;

    font-size: .8rem;
}

.user-detail{
    display: flex;
    gap:.35rem;
}


.detail-value{
    color: var(--main-text-color);
}


#graphs{
    display: grid;
    grid-template-columns: repeat(2,  1fr);
    gap: 1rem;

    margin-top: 2rem;
}


#graph-1{
    grid-column: 1 / -1;
    position: relative;
}

#graph-1, #graph-2, #graph-3{
    padding: 1.5rem;
    
    background-color: var(--surface-color);
    border-radius: 10px;
}

#graphs svg{
    display: block;
    width: 90%;
    height: auto;
    margin: 0 auto;
}

/* Empty Data */
#no-projects {
    margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 300px;
    width: 100%;

    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.03em;

    border: 1px dashed var(--border-color);
    border-radius: 12px;

    background: var(--surface-color);
}

#no-skills{
     margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 300px;
    width: 100%;

    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.03em;

    border: 1px dashed var(--border-color);
    border-radius: 12px;

    background: var(--surface-color);
}

#ratio-comment{
    margin: 0.5rem 0 0;

    text-align: center;
    color: var(--main-text-color);
    font-size: .95rem;
    font-weight:500;
    letter-spacing: 0.05rem;
}

.graph-title{
    margin: 0 0 1rem;

    color: var(--main-text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.audit-values{
    display: flex;
    justify-content: center;
    gap: 1.5rem;

    width: 100%;
    
    margin-top:.75rem ;
    
}

.audit-value{
    flex: 1;
    
    max-width: 210px;
    
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: .9rem 1.2rem;
    background: var(--elevated-surface-color);

    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    
}

.audit-label {
    margin-bottom: 0.35rem;

    color: var(--secondary-text-color);

    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.audit-number {
    color: var(--main-text-color);

    font-size: 1.05rem;
    font-weight: 600;

    white-space: nowrap;
}
#up-arrow,
#down-arrow {
    display: inline-block;

    margin-right: 0.35rem;

    font-size: 1.2rem;
    font-weight: 900;
}

#up-arrow {
    color: var(--main-text-color);
}

#down-arrow {
    color: var(--primary-red);
}

/* Tooltip */

#graph-tooltip{
    position: absolute;

    padding: 0.75em 1rem;
    background-color: var(--elevated-surface-color);
    color: var(--main-text-color);

    border: 1px solid var(--border-color);
    border-radius: 6px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);

    font-size: 0.9rem;

    pointer-events: none;
    white-space: nowrap;

    z-index: 10;

}

#graph-tooltip strong{
    display: block;
    margin-bottom: 0.25rem;

    color: var(--bright-red);
}

#graph-tooltip span{
    display: block;
    color: var(--secondary-text-color);
}

/* Login SVG  */
.login-illustration {
    display: block;

    width: 100%;
    max-width: 900px;
    height: auto;

    margin: 0 auto 1.5rem;
}
.login-illustration circle {
    transform-box: fill-box;
    transform-origin: center;
}

.login-illustration .graph-lines-red path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;

    animation: line-reveal 5s ease-in-out infinite;
}

@keyframes line-reveal {
    0% {
        stroke-dashoffset: 100;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -100;
    }
}

/* Toast */
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    width: 100%;
    padding: 0.85rem 1rem;

    border: 1px solid var(--border-color);
    border-radius: 6px;

    background-color: var(--elevated-surface-color);
    color: var(--main-text-color);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);

    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;

    animation: toast-slide-in 180ms ease-out;
}

.toast.error {
    border-color: rgba(240, 48, 48, 0.65);
    background-color: rgba(143, 21, 21, 0.25);
    color: var(--bright-red);
}
.toast.success{
    border-color: rgba(13, 182, 50, 0.65);
    background-color: rgba(22, 121, 43, 0.25);
    color: rgba(5, 189, 51, 0.65);
}

.toast-hide {
    animation: toast-slide-out 150ms ease-in forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
}



@media (768px <= width <= 1023px) {
    #graphs{
        grid-template-columns: 1fr;
        
    }
    #graph-1, #graph-2, #graph-3{
        padding: 1.25rem;
        grid-column: 1/-1;
        
    }
    #graphs svg{
        width: 100%;
    }
    .login-illustration {
        display: none;
    }
}

@media ( width <= 767px) {
    #app:has(> #login-view) {
        justify-content: center;
        padding: 1.5rem;
    }
    #login-view {
        padding: 1.5rem;
    }

    #login-view h1 {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
    }
    .login-illustration {
        display: none;
    }
    
    #title h1 {
        font-size: 2.25rem;
    }

    #user-info {
        padding: 1.5rem 1rem;
    }

    .user-avatar {
        width: 120px;
        height: 120px;
    }

    .user-name {
        font-size: 1.5rem;
    }

    .user-stats {
        flex-direction: column; 
        gap: 0.75rem;
    }
    .user-stat + .user-stat {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
    }

    .user-details {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    /* Graphs & Charts */
    #graphs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    #graph-1, #graph-2, #graph-3 {
        padding: 1rem;
        grid-column: 1 / -1;
    }

    #graphs svg {
        width: 100%;
    }
}

@media (hover: none) {
    .user-avatar img {
        transform: rotateY(0deg);
        filter: grayscale(0%);
        border-color: var(--primary-red);
    }
}
