@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&display=swap');

@import url('./xp.css');
@import url('./movementCard.css');
@import url('./movementList.css');
@import url('./spellCard.css');
@import url('./spellList.css');
@import url('./atributesCard.css');
@import url('./carousel.css');
@import url('./equipment.css');
@import url('./sliderToggle.css');
/* @import url('./combobox.css'); */
@import url('./classes.css');

:root {
    --main_font: 'Cinzel', serif;
    --secondary_font: "Cormorant Garamond", serif;
    --border-color: #000;
    --muted: #777;
    --danger: rgba(90, 0, 10, 0.9);
    --gold: rgba(180, 140, 60, 1);
    --dark: rgba(10, 12, 15, 1);
    --blue: rgb(36, 66, 86);
    --green: rgb(39, 84, 45);
    --red: rgb(143, 0, 17);
    --amber: rgb(194, 110, 14);
    --purple: rgb(83, 0, 83);
    --white: #fff;

    --iron: rgba(115, 120, 125, 1);
    --steel: rgba(155, 160, 165, 1);
    --silver: rgba(205, 210, 215, 1);
    --gold: rgba(190, 150, 45, 1);
    --bronze: rgba(155, 100, 45, 1);
    --copper: rgba(175, 90, 55, 1);
    --mithril: rgba(175, 215, 225, 1);
    --adamantine: rgba(45, 50, 55, 1);

    --ruby: rgba(190, 25, 45, 1);
    --sapphire: rgba(35, 85, 190, 1);
    --emerald: rgba(30, 155, 85, 1);
    --amethyst: rgba(125, 65, 180, 1);
    --diamond: rgba(215, 235, 240, 1);
    --topaz: rgba(225, 165, 45, 1);
    --onyx: rgba(30, 30, 35, 1);
    --opal: rgba(190, 215, 210, 1);

}

html {
    font-family: var(--main_font);
}

body {
    background: radial-gradient(circle at center,
            var(--gold) 0%,
            var(--danger) 55%,
            var(--dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-basis: 100%;
    overflow-y: auto;
    padding-bottom: 4rem;
}

body>article {
    flex: 1;
}

.rodape {
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    align-self: flex-end;
    flex-shrink: 0;
    margin-top: 24px;
}

.pagina {
    font-family: var(--main_font);
    margin: 1.5rem;
    color: #111;
}

.sheet {
    margin: auto;
    width: 90vw;
    background: var(--white);
    border: 2px solid var(--border-color);
    box-shadow: 1px 1px 5px 4px rgba(106, 126, 35, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sheet-container {
    display: flex;
    flex-direction: row;
    min-height: 40rem;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.sheet-header {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: space-between;
    align-items: flex-end;
    alignment-baseline: central;
    gap: 12px;
    border-bottom: 1px solid #000;
    width: 90vw;
}

.equipment-sheet {
    width: 90vw;
    height: 30vh;
    margin: auto;
    background: var(--white);
    border: 2px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.equipment-sheet-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
}

.equipment-controllers {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
}

.equipment-form-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.equipment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    overflow-y: auto;
}

.equipment-form-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.custom-equip-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    overflow-y: auto;
}


.equipment-consumables-container {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

input,
select,
textarea {
    font-family: var(--main_font);
    font-size: 1rem;
    color: #111;
    background: transparent;
    border: none;
    outline: none;
    font-weight: bold;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
    color: var(--gold);
    font-weight: bold;
}

select {
    width: 100%;
}

select option:hover {
    color: var(--gold);
}

select::picker(select) {
    appearance: base-select;
    background-color: var(--muted);
    border: 2px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--main_font);
    font-weight: 700;
}



.title {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.title input {
    width: 100%;
    font-size: 3rem;
    border: none;
    outline: none;
    font-family: var(--main_font);
    font-weight: 800;
}

.subtitle {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.subtitle input,
.subtitle select {
    padding: 6px;
    width: 100%;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 1rem;
    border: none;
    outline: none;
    font-family: var(--main_font);
    font-weight: bold;
}

.subtitle select option.disabled-by-race,
.subtitle select option[disabled] {
    color: var(--danger);
    background: transparent;
}

.subtitle select option:checked {
    color: var(--gold);
}


.portrait {
    border: 2px dashed #aaa;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 22px;
    text-align: center;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.charLevelInput {
    margin: 1rem 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    width: 3rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--gold);
}

.card {
    border: 0px dotted var(--border-color);
    border-radius: 25px;
    padding: 12px;
    text-align: center;
    background: rgba(219, 219, 219, 0.192);
}

.card label {
    display: block;
    font-family: var(--main_font);
    font-weight: bold;
    margin-bottom: 8px;
}

.card input {
    width: 80%;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 24px;
    background: transparent;
}

.pv-pair {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    /* Uniform spacing between inputs and the slash */
}

.pv-pair input {
    width: 50%;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 1.5rem;
    background: transparent;
}

.pv-pair input:placeholder-shown {
    width: 50%;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    font-size: 0.8rem;
    background: transparent;
    padding-bottom: 5%;
}

/* Bonds */
.bondsArea {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: baseline;
}

.bonds {
    margin: 1rem 0;
}

.bonds-input-box {
    display: flex;
    flex-direction: row;
    margin-bottom: 12px;
}

.bond_input_template {
    width: 70%;
    text-align: center;
    font-size: 16px;
    border: none;
    border-bottom: 0.5px dashed var(--border-color);
    margin-bottom: 6px;
}

.bond_input_target {
    width: 25%;
    text-align: center;
    font-size: 16px;
    border: none;
    border-bottom: 0.5px dashed var(--border-color);
    margin-bottom: 6px;
}

.bond-name {
    color: var(--dark);
    font-size: 16px;
}

.bond-template {
    color: var(--dark);
    font-size: 16px;
}

.bond-end {
    background-color: var(--red);
    font-family: var(--main_font);
    font-weight: bold;
    color: var(--white);
    border: none;
    border-radius: 4px;
}

/* // Movement and Spells */
.movement-controller {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    alignment-baseline: central;
    margin-bottom: 1rem;
}

.movement_availiable {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    flex-basis: 24rem;
    flex-grow: 3;
}



.spells {
    border-left: 2px solid var(--border-color);
    padding-left: 20px;
}

.spells-controller {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    alignment-baseline: central;
    margin-bottom: 1rem;
}

.spell_availiable {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    flex-basis: 24rem;
    flex-grow: 3;
}

.spell-group {
    margin-bottom: 20px;
}

.spell-group h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.spell {
    line-height: 0.9rem;
    color: var(--gold);
    font-size: 0.5rem;
}

.spell {
    display: flex;
    align-items: center;

    /* margin-bottom: 6px; */
    font-size: 16px;
    border-radius: 10px;
}

.spell input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
}

.spell input[type="checkbox"]:checked {
    background-color: var(--gold);
    border-color: var(--gold);
}

.spell:has(.gold_filling:checked) {
    background: rgba(180, 140, 60, 0.5);
}

.spell:has(.blue_filling:checked):has(.gold_filling:checked) {
    .spell-name {
        color: var(--white);
        background: rgba(180, 140, 60, 0.5);
        border-radius: 10px;
        padding-left: 11px;
    }

    .blue_filling,
    .gold_filling {
        accent-color: var(--gold);
    }

}

.spell-name {
    border: none;
    border-bottom: 1px dashed transparent;
    font-family: var(--main_font);
    font-size: 16px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
}

.spell-name:focus {
    border-bottom: 1px dashed var(--border-color);
}

.spell input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.gold_filling {
    accent-color: var(--gold);
}

.blue_filling {
    accent-color: var(--blue);
}

.red_filling {
    accent-color: var(--red);
}

.grey_filling {
    accent-color: var(--muted);
}

.addConsumable {
    cursor: pointer;
    color: var(--green);
    font-weight: bold;
    font-size: 32px;
    line-height: 1;
    border: none;
    background: transparent;
    padding: 0 4px;
}

.removeIcon {
    cursor: pointer;
    color: var(--red);
    font-weight: bold;
    font-size: 32px;
    line-height: 1;
    border: none;
    background: transparent;
    padding: 0 4px;
}



.charNotes-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Makes the wrapper take up all available flex space */
    height: 100%;
}

.charNotes {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Makes the wrapper take up all available flex space */
    height: 100%;
}

.charNotes .q1-editor {
    overflow-y: auto;
}

/* === Barra e modais de código === */
#saveBar {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

nav button {
    padding: 10px 18px;
    background: #222;
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: var(--main_font);
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

nav button:hover {
    background: #444;
}

nav .save_buttons {
    margin-left: auto;
}

.dw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dw-modal {
    background: var(--white);
    border: 2px solid var(--dark);
    padding: 28px;
    max-width: 520px;
    width: 92%;
    font-family: var(--main_font);
}

.dw-modal h3 {
    margin: 0 0 10px;
}

.dw-modal p {
    margin: 0 0 10px;
    font-size: 14px;
    color: #444;
}

.dw-modal textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--main_font);
    font-size: 12px;
    padding: 8px;
    border: 1px solid var(--dark);
    resize: vertical;
}

.dw-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.dw-modal-actions button {
    padding: 8px 18px;
    background: #222;
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: var(--main_font);
    font-size: 14px;
}

.dw-modal-actions button:hover {
    background: #444;
}

.dw-modal-actions button.secondary {
    background: #888;
}

.dw-modal-actions button.secondary:hover {
    background: #666;
}

#restoreError {
    color: var(--danger);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.init-val.used {
    text-decoration: line-through;
    color: #999;
}

/*Footer*/
footer {
    text-align: center;
    margin-top: 24px;
    font-size: 16px;
    color: var(--white);

}

footer p a {
    text-decoration: none;
    color: var(--white);
    font-weight: 800;

}

footer p a:hover {
    color: var(--gold);

}

/* Change the font of the actual text inside the editor */
.ql-container.ql-snow .ql-editor {
    font-family: var(--main_font);
    font-size: 16px;
}

/* Ensure the toolbar dropdown reflects your new default label */
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
    font-family: var(--main_font);
}



.movement-view-toggle {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.btnMovementTab {
    height: 20px;
    padding: 6px 12px;
    margin-bottom: 1px;
    background: #222;
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: var(--main_font);
    font-size: 14px;
    border-radius: 4px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); */
}

.btnMovementTab.selected {
    background: var(--gold);
}

.movement-available {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-bottom: 0.8rem;
}


.multiselect {
    width: 350px;
    border: 1px solid #888;
    border-radius: 6px;
    background: white;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;

}

.tag:hover {
    background: #eee;
}

.tag-title {
    font-weight: bold;
    color: var(--gold);

    &::after {
        content: ": ";
    }
}

.tag-description {
    font-style: italic;
    font-size: 0.9em;
}

.tag button {
    border: none;
    background: none;
    cursor: pointer;
}

.combobox {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    min-width: 240px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 6px;
    background: white;
}

.combobox-toggle {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gold);
    font-size: 1em;
    padding: 2px 4px;
    line-height: 1;
}

.combobox-dropdown {
    position: fixed;
    z-index: 200;
    min-width: 30rem;
    display: flex;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    display: none;
}

.combobox-dropdown.open {
    display: block;
}

.tag-search {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 4px 4px 0 0;
}

.results {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
}

.results:empty {
    display: none;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--gold);
    color: white;
    font-size: 0.85em;
    font-weight: bold;
}

.tag-pill button {
    border: none;
    background: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    padding: 0;
}

.result:hover {
    background: #eee;
}

/* Mobile First - Base para dispositivos móveis */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0;
        scroll-behavior: smooth;
        overflow-x: hidden;
    }

    /* Navegação */
    .floating-nav {
        position: fixed;
        bottom: 0;
        width: 100%;
        background: #1a1a1a;
        border-top: 2px solid #d4af37;
        z-index: 1000;
        padding: 10px 0;
    }

    .save_buttons {
        display: flex;
        gap: 8px;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .save_buttons button {
        flex: 1;
        min-width: 80px;
        padding: 10px 8px;
        font-size: 12px;
    }

    /* Páginas */
    .pagina {
        width: 100vw;
        height: auto;
        scroll-snap-align: start;
    }

    .sheet {
        padding: 15px;
    }

    /* Título */
    .title {
        margin-bottom: 15px;
    }

    #charName {
        font-size: 1.5rem;
        width: 100%;
        margin-bottom: 10px;
    }

    .subtitle {
        display: flex;
        gap: 10px;
    }

    .subtitle select {
        flex: 1;
        padding: 8px;
    }

    /* Stats Cards */
    .stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 15px 0;
    }

    .stats .card {
        padding: 10px;
        text-align: center;
    }

    .stats label {
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
        font-size: 12px;
    }

    .stats input {
        width: 100%;
        padding: 5px;
        font-size: 12px;
    }

    .pv-pair {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .pv-pair input {
        flex: 1;
        max-width: 60px;
    }

    /* Atributos Iniciais */
    .initial-attributes-container {
        margin: 15px 0;
        padding: 10px;
        font-size: 12px;
    }

    .init-val {
        cursor: pointer;
        margin: 2px;
        display: inline-block;
    }

    /* XP, Alinhamento, Vínculos */
    .charXPBonds {
        /* display: flex;
    flex-direction: column; */
    }


    .alignment-container {
        margin-top: 12px;
        gap: 0.5rem;
    }

    .charAlignment {
        width: 100%;
        padding: 8px;
        margin-top: 5px;
        margin: 1rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);

        option {
            font-size: 12px;
            padding: 5px;
        }
    }

    .bonds {
        padding: 10px;
    }

    .bond-inputs-box {
        display: flex;
        gap: 5px;
        margin: 10px 0;
    }

    .bond_input_template,
    .bond_input_target {
        flex: 1;
        padding: 8px;
        font-size: 12px;
    }

    #btnAddBond {
        padding: 8px 12px;
        color: #000;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

    .bonds_area {
        margin-top: 10px;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Equipment Page */
    .equipment-sheet {
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    #equipmentpanel,
    #consumablePanel {
        padding: 10px;
    }

    #equipmentpanel h2,
    #consumablePanel h2 {
        margin: 0 0 10px 0;
        font-size: 16px;
    }

    #addEquipment,
    #addConsumable {
        width: 40px;
        height: 40px;
        padding: 0;
        margin-bottom: 10px;
        cursor: pointer;
    }

    #equipmentContainer,
    #consumablesContainer {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Movement Page */
    #Movements {
        padding: 15px;
    }

    .sheet-header {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    .movement-controller,
    .spells-controller {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #toggleGroupMovement {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .movement-view-toggle,
    .spell-view-toggle {
        display: flex;
        gap: 10px;
    }

    .btnMovementTab {
        flex: 1;
        padding: 8px;
        cursor: pointer;
        text-align: center;
        background: transparent;
        color: #d4af37;
    }

    .btnMovementTab.active {
        background: #d4af37;
        color: #000;
    }

    #movementSearch {
        width: 100%;
        padding: 8px;
        font-size: 12px;
    }

    /* Notes Page */
    #charNotes {
        min-height: 200px;
        padding: 10px;
        margin-bottom: 15px;
    }

    .charNotes-container {
        margin-bottom: 20px;
    }

    .charNotes-container h2,
    #4th-Page>aside h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Modals */
    .dw-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2000;
    }

    .dw-modal {
        background: #2a2a2a;
        padding: 20px;
        border-radius: 8px;
        width: 90%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .dw-modal h3 {
        margin-top: 0;
    }

    #codeModalText,
    #restoreCodeInput {
        width: 100%;
        padding: 10px;
        font-size: 12px;
        resize: vertical;
    }

    .dw-modal-actions {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }

    .dw-modal-actions button {
        flex: 1;
        padding: 10px;
        cursor: pointer;
        border-radius: 4px;
    }

    /* Footer */
    .rodape {
        padding: 20px 15px;
        margin-top: 20px;
        font-size: 12px;
    }

    .rodape p {
        margin: 8px 0;
    }
}