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

body {
    font-family: 'Philosopher', sans-serif;
    background-color: #000;
    margin: 0;
    padding: 20px;
    color: #faf1ff7c;
}

.character-sheet {
    background-image: url('../images/textures/texture3.png');
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 1200px;
    margin: 0 auto;
    color: #000000; /* Text color on parchment background */
}

header {
    text-align: center;
    margin-bottom: 10px;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}

.character-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.info {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap; /* Changed from wrap to nowrap */
    margin-top: 5px;
    font-size: 1.1em;
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
}

.info-block {
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 10px;
    background-color: #faf1ff7c; /* Slightly darker than parchment */
    margin: 5px;
    white-space: nowrap; /* Prevent text wrapping inside the blocks */
}

.main-content {
    display: flex;
    justify-content: space-between;
    gap: 10px; /* Add space between columns */
}

.column {
    flex: 1;
    margin: 0 5px;
}

.left-column {
    max-width: 220px; /* Adjusted width */
}

.right-column {
    flex: 2;
}

.box {
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 10px;
    background-color: #4d4d4dcc; /* Slightly darker than parchment */
    margin-bottom: 10px;
    width: auto;
}

.attributes {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.attribute {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    width: 90%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #000000;
    border-radius: 10px;
    background-color: #faf1ff7c; /* Darker background for attributes */
}

.attribute .label {
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.score-block {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 5px;
}

.attribute .value,
.attribute .modifier {
    font-size: 14px;
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 5px;
    background-color: #faf1ff7c; /* Slightly darker than parchment */
    text-align: center;
    flex: 1;
    margin: 0 5px;
}

.saving-throw {
    text-align: center;
    margin-top: 5px;
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 5px;
    background-color: #faf1ff7c; /* Slightly darker than parchment */
    display: flex;
    align-items: center;
    justify-content: center;
}

.saving-throw .proficiency {
    width: 10px;
    height: 10px;
    border: 1px solid #000000;
    border-radius: 50%;
    margin-right: 5px;
}

.skills {
    margin-top: 10px;
    width: 100%;
}

.skill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.skill .proficiency {
    width: 10px;
    height: 10px;
    border: 1px solid #000000;
    border-radius: 50%;
    margin-right: 5px;
}

.skill .proficiency.filled {
    background-color: #000000;
}

.skill span {
    flex: 1;
    margin-left: 5px;
}

.skill .skill-value {
    text-align: right;
}

.proficiency-bonus {
    text-align: center;
    margin-top: 10px;
}

.proficiency-bonus h3 {
    margin: 0;
}

.proficiency-bonus span {
    font-size: 20px;
    font-weight: bold;
}

.passive-perception {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #000000;
    border-radius: 10px;
    background-color: #faf1ff7c; /* Slightly darker than parchment */
}

.passive-perception h3 {
    display: inline;
    margin-right: 5px;
}

.passive-perception span {
    font-weight: bold;
}

.other-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    justify-content: space-between;
}

.horizontal-stats .stat {
    flex: 1;
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 10px;
    margin: 5px;
    text-align: center;
    background-color: #faf1ff7c; /* Darker background for stats */
}

.attacks-spellcasting, .equipment, .features-traits, .proficiencies {
    margin-bottom: 10px;
}

.attacks-spellcasting h3, .equipment h3, .features-traits h3, .proficiencies h3, .spells h3 {
    text-align: center;
    margin-bottom: 5px;
}

.attack {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 10px;
    background-color: #faf1ff7c; /* Darker background for attacks */
}



.spell-level {
    margin-top: 10px;
    padding: 25px 5px 5px 5px; /* Adjusted padding to separate spells from the title */
    border: 1px solid #000000;
    border-radius: 10px;
    position: relative; /* To position the SP block */
    background-color: #faf1ff7c; /* Darker background for spell levels */
}

.spell-level h4 {
    margin: 0;
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1em;
    background-color: #faf1ff7c; /* Match background to box color */
    padding: 0 5px; /* Add padding to separate text from border */
}

.spell-points {
    position: absolute;
    top: 5px;
    right: 5px;
    font-weight: bold;
    background-color: #faf1ff7c; /* Match background to box color */
    padding: 2px 5px;
    border: 1px solid #000000;
    border-radius: 5px;
}

.spell {
    padding: 5px 0; /* Adjusted padding to move spells down */
}

.spell .spell-name {
    font-weight: bold;
}

.spell .spell-info {
    display: inline-block;
    margin-left: 10px;
    word-wrap: break-word; /* Ensure long text wraps */
}

.spell-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.spell-stats .spell-stat {
    flex: 1;
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 10px;
    margin: 5px;
    text-align: center;
    background-color: #faf1ff7c; /* Darker background for spell stats */
}

.equipment-item {
    padding: 5px;
    display: inline-block;
    border: 1px solid #000000;
    border-radius: 5px;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #faf1ff7c; /* Darker background for equipment items */
}

.proficiency-block, .feature-block {
    padding: 5px;
    border: 1px solid #000000;
    border-radius: 5px;
    margin-bottom: 5px;
    background-color: #faf1ff7c; /* Darker background for proficiency and feature blocks */
}

.equipment ul {
    list-style-type: none;
    padding: 0;
}

.equipment li {
    padding: 5px 0;
}

.proficiencies p {
    padding: 2px 0;
}

.features-traits p {
    padding: 2px 0;
}

.spell a:link, .spell a:visited {
  color: inherit; /* Inherits the color from the parent element */
  text-decoration: underline; /* Adds an underline */
}

.attack-details,
.spell-details {
    margin-top: 5px;
    padding: 5px;
    border-top: 1px solid #000000;
    font-size: 0.9em;
    color: #000000;
    background-color: #faf1ff7c; /* Match the background of the attacks/spells section */
}

@media screen and (max-width: 600px) {
    .character-sheet {
        padding: 10px;
        font-size: 0.8em;
    }

    header h1 {
        font-size: 1.5em;
    }

    .info {
        flex-direction: row; /* Ensure horizontal alignment */
        justify-content: flex-start; /* Align items to the start */
    }

    .info-block {
        flex: none; /* Prevent flex-grow */
    }

    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .column {
        width: 100%;
        margin: 0;
        padding-right: 10px;
    }

    .box {
        width: 100%;
    }

    .attribute {
        width: 90%;
    }
    
    .other-stats .stat {
        width: 100%;
    }

    .attack, .spells {
        flex-direction: column;
        align-items: center;
    }

    .attack span, .spells p {
        width: 100%;
        text-align: center;
    }

    .equipment ul {
        padding-left: 20px;
    }
}