/* @import url('https://fonts.cdnfonts.com/css/franklin-gothic'); */
@import url('https://fonts.googleapis.com/css2?family=Cactus+Classical+Serif&display=swap');

@import './reset.css';
@import './banner.css';



:root {
    --black: #221e20;
    --focus: #bdbdc1;
    --light: #c7c8ca;
    --muted: #dbdddf;
    --white: #ffffff;
    --font-family: 'Cactus Classical Serif', serif;
}

body {
    font-family: var(--font-family);
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

nav{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: var(--focus);
    color: var(--white);
    border-bottom: 2px solid var(--focus);

    img{
        height: 3rem;
        width: auto;
    }
    button{
        border-radius: 0.5rem;
        background-color: var(--black);        
        color: var(--white);
        border: 2px solid var(--focus);
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s;
        padding: 0.5rem 1rem;
    }
    button:hover{
        background-color: var(--light);
        color: var(--black);
    }
}

footer{
    display: flex;
    flex-direction: column;
    justify-content: justify; 
    align-items: center; 
    background-color: var(--black);
    color: var(--white);
    border-top: 2px solid var(--focus);
    margin-top: 1rem;

    a{
        color: red;
        text-decoration: none;
    }

    p{
        font-size: 0.5rem;
        margin: 0;
        padding: 0.5rem 0;
    }
    p:first-of-type{
        font-size: 0.75rem;
        margin: 0;
        padding: 0.5rem 0;
    }

}


main{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin: 1rem;
}

article{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 1rem;
}

.input-field {
    position: relative;
    width: 100%;
    height: 3rem;
    border-bottom: 1px solid var(--focus);
    margin-bottom: 1rem;
}

.input-field input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 1rem 0 0.25rem;
    font-size: 1rem;    
}

.input-field label {
    position: absolute;
    top: 3.1rem;
    left: 0;
    color: var(--focus);
    pointer-events: none;
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
}

input:focus + label {
    color: var(--black  );
}

.header-label {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    color: var(--white);
    background-color: var(--black);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    margin-right: auto;

}


/* Agrupamentos */
.section-character-info{
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.character-extra-fields {
    width: 100%;
}

.character-extra-fields summary {
    position: absolute;
    top: 0.15rem;
    right: 0.1rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--focus);
    border-radius: 50%;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(34, 30, 32, 0.18);
}

.character-extra-fields summary::-webkit-details-marker {
    display: none;
}

.character-extra-fields summary::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    width: 0.35rem;
    height: 0.35rem;
    border-right: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.character-extra-fields[open] summary::before {
    transform: rotate(225deg);
    top: 0.5rem;
}

.character-extra-fields summary:focus-visible {
    outline: 2px solid var(--black);
    outline-offset: 2px;
}

.character-extra-fields .input-field {
    width: 100%;
}


#nome{
    flex: 1;
    flex-grow:2;
}
#bando{
    flex: 1;
    flex-grow:1;
}
#alcunha{
    flex: 1;
    flex-grow:1;
}
#aparencia{
    flex: 1;
    flex-grow:3;
}
#background{
    flex: 1;
    flex-grow:1;
}
#historia{
    flex: 1;
    flex-grow:1;
}
#vicios{
    flex: 1;
    flex-grow:3;
}


.section-stress-trauma{
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;

    span{
        background-color: var(--black);
        color: var(--white);
        font-weight: 700;
        text-transform: uppercase;
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
    }
    .stress{
        display: flex;
        flex-direction: row;
        flex-basis: 100%;
        flex-grow: 1;
        border-top: 2px solid var(--black);
    }
    .trauma{
        display: flex;
        flex-direction: row;
        flex-basis: fit-content;
        flex-grow: 1;
        border-top: 2px solid var(--black);
    }

}


.bannerContainer{
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    box-sizing: border-box;
    gap: .5rem;

    & > * {
        transform: translateY(1px);
        margin-right: auto;
        margin-left: auto;
    }   

}

.section-condition{
    display: flex;
    flex-direction: column;
    margin-bottom: .5rem;
}

#damageContainer{
    display: flex;
    flex-direction: column;

    .damage-header{
        padding-left: 0.5rem;
        width: 100%;
        margin: 0;
        background-color: var(--black);
        color: var(--white);
        font-size: 0.75rem;
        font-weight: 900;
        text-transform: uppercase;
        box-sizing: border-box; 

    }

    .damage-box{
        display: flex;
        flex-direction: column;
        width: 100%;
    
        div{
            display: flex;
            flex-grow: 1;
            width: 100%;
        }

        span{
            display: flex;
            max-width: 3rem;
            border-bottom: 1px solid var(--focus);
            background-color: var(--muted);
            color: var(--black);
            font-weight: 900;
            justify-content: center;
            align-items: center;
            padding: 0 .5rem;
        }

        .damage-effect{
            display: flex;
            width: 3rem;
            border-bottom: 1px solid var(--focus);
            background-color: var(--muted);
            color: var(--black);
            font-weight: 900;
            justify-content: justify;
            align-items: center;
            padding: 0 .5rem;
        }
        
        input{
            display: flex;
            flex-grow: 1;
            flex-basis: 1rem;
            flex-shrink: 1;
            width: 100%;
            line-height: 2rem;
            border: none;
            border-bottom: 1px solid var(--focus);
            outline: none;
            background: transparent;
        }

        input + input {
            border-left: 1px solid var(--focus);
        }
    }
}


#art-playbook{
    display: flex;
    flex-direction: column;
    background-color: var(--muted);

    
    .art-playbook-header{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        background-color: var(--focus);
        color: var(--white);
        font-weight: 700;
        text-transform: uppercase;
    }
}

.playbook-selector{
    select, ::picker(select) {
    appearance: base-select;
    }

    /* Style the button container */
    select {
    background-color: #1e1e1e;
    color: white;
    padding: 12px;
    border-radius: 8px;
    }

    /* Style the floating dropdown menu itself */
    select::picker(select) {
    background-color: #2d2d2d;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* Style individual options */
    option {
    padding: 10px;
    color: #ccc;
    border-radius: 4px;
    }

    /* Style the hovered option */
    option:hover {
    background-color: #0066cc;
    color: white;
    }
}

.movement-container{
    display: flex;
    flex-direction: column;
    gap: .5rem;

    .movement-box{
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        
        .movement-header{
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            gap: .5rem;
            
            .header-label{
                font-weight: 700;
                color: var(--white);
                width: 100%;
                margin-left: auto;
            }
        }

        .move-description{
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            margin-left: 1rem;
            color: var(--black);
            
        }
    }
    
}


.section-abilities-actions{
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    flex-grow: 1;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .5rem;

    .ability-container{
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: .5rem;
        box-sizing: border-box;
    }
    .actionList{
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    .actionContainer{
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: .5rem;
    }

}








.action-label{
    display: flex;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.checkbox-container {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.action-checkbox {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;  
    display: flex;
    margin-left: auto;
    margin-right: auto;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 1px solid var(--black);
    background-color: var(--white);
    transition: background-color 0.2s ease, border-color 0.2s ease;

    &:checked {
        background-color: var(--black);
    }

    &:first-child:checked {
        background-color: red; /* Or use a CSS variable like var(--red) */
        border-color: red;     /* Optional: makes the border match the red fill */
    }

}

.dw-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.dw-modal {
    background-color: var(--white);
    color: var(--black);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: min(90vw, 30rem);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);

    h3 {
        margin-top: 0;
    }

    textarea, select {
        width: 100%;
        box-sizing: border-box;
        font-family: inherit;
    }
}

.dw-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;

    button {
        border-radius: 0.5rem;
        background-color: var(--black);
        color: var(--white);
        border: 2px solid var(--focus);
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s;
        padding: 0.5rem 1rem;
    }
    button:hover {
        background-color: var(--light);
        color: var(--black);
    }
    button.secondary {
        background-color: var(--muted);
        color: var(--black);
    }
}

@media (min-width: 768px) {
    nav{
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }

    main{
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        flex-wrap: wrap;
    }
    article{
        display: flex;
        flex-direction: column;
        margin-bottom: 1rem;
        gap: 1rem;
        align-items: flex-start;
        flex-wrap: nowrap;
    }

}