.app {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr;
    height: 100vh;
}

.top-menu {
    grid-column: span 1;
    padding-bottom: 10vh;
}


.units-view {
    display:grid;
    /* A padding column on left and right, keeping the three central ones with a 2:3:2 ratio. */
    grid-template-columns: 1fr 2fr 3fr 2fr 1fr;
}

.left-bar {
    grid-column: 2;
}

.center-bar{
    grid-column: 3;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 20px;
}

.right-bar {
    grid-column: 4;
}


.roster-view {
    display:grid;
    /* A padding column on left and right, keeping the three central ones with a 2:3:2 ratio. */
    grid-template-columns: 1fr 2fr 3fr 2fr 1fr;
}

.unit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    max-height: 100%;
    overflow-y: auto;
}

.selected-units {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2em;
    color: #666;
}

.total-points {
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.button {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    font-size: 1em;
}

.button:hover {
    background-color: #e0e0e0;
}

.button.selected {
    background-color: #4a90e2;
    color: white;
}

.label{
    font-weight: bold;  /* Thick style */
    padding: 16px;
    background-color: transparent;  /* Light gray background for visibility */
    text-align: left;
    font-size: 24px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.label.center{
    text-align: center;
}


/*TOP MENU*/
.top-menu {
    display: grid;
    grid-template-rows: auto 0.3fr;
    vertical-align: middle;
}

.title {
    text-align: center;
    background-color: transparent;
    border: none;
    padding: 12px 0px;
    vertical-align: middle;
    text-decoration: none;
    font-size: 1.6rem;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold; /* Make the font bold */
    text-transform: uppercase;
}

.menu {
    text-align: center;
    background-color: transparent;
    border: none;
    padding: 0px 0px;
    vertical-align: middle;
    text-decoration: none;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold; /* Make the font bold */
    text-transform: uppercase;
}

.top-menu button {
    background-color: transparent;
    border: none;
    padding: 8px 48px;
    text-align: center;
    vertical-align: middle;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-weight: bold; /* Make the font bold */
    text-transform: uppercase;
}

.top-menu button:hover {
    background-color: rgba(220, 220, 220, 0.5);
    transition: 0.7s;
}


/* SIDE BARS */

.left-bar, .right-bar {
    background-color: transparent;
    padding: 10px;
    box-sizing: border-box;
    overflow: visible;
    width: auto;
}

.left-bar button, .right-bar button, .central-area button {
    display: block; /* This ensures each button is on a new line */
    background-color: transparent;
    border: none;
    padding: 15px 12px;
    text-decoration: none;
    font-size: 16px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    margin: 4px 2px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

.left-bar button:hover, .right-bar button:hover, .central-area button:hover {
    background-color: rgba(220, 220, 220, 0.5);
    transition: 0.7s;
}

.left-bar button {
    font-variant: small-caps;
    text-align: left;
}

.right-bar button {
    font-variant: small-caps;
    text-align: right;
}

.left-bar {
    text-align: left; /* This ensures content in the left bar is left-aligned */
    align-items: left;
}

.left-bar button.selected, .right-bar button.selected {
    background-color: rgba(220, 220, 220, 0.5);
}

.right-bar {
    text-align: right; /* This ensures content in the right bar is right-aligned */
    align-items: right;
}

.left-menu {
    overflow: visible;
    transition: max-height 0.5s ease;
    max-height: 500px; /* Adjust based on the height of the menu button */
}

.left-menu.expanded {
    max-height: 600px; /* Adjust based on the maximum height you expect the menu to be */
}

.left-menu-content {
    overflow: hidden;
    transition: opacity 0.5s ease;
    opacity: 0;
    height: 0;
}

.left-menu.expanded .left-menu-content {
    opacity: 1;
    height: auto;
}

.left-bar .left-menu > button {
    font-size: 20px; /* Adjust this value to your preference */
    text-transform: uppercase;
}

.button.selected {
    background-color: grey;
    /* Other styles for selected profile button */
}


/* PROFILE LAYOUT */

.profile-details {
    display: grid;
    justify-content: space-evenly;
    height:auto;
    padding: 10px;
    grid-template-rows: auto 60 px;
    grid-template-columns: 1fr 1fr 1fr;
}

.profile-name {
    text-align: center;
    grid-column: span 3;
    grid-row: 1;

    /* Bottom border */
    border-bottom: 4px solid #666;
    border-radius: 2px;

    font-weight: bold;  /* Thick style */
    text-transform: uppercase;
    padding: 18px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 24px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.profile-description {
    text-align: center;
    grid-column: span 3;
    grid-row: 2;

    font-variant: small-caps;
    font-weight: bold;  /* Thick style */
    padding: 12px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 24px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.profile-cost {
    text-align: center;
    grid-column: span 3;
    grid-row: 3;

    font-variant: small-caps;
    font-weight: bold;  /* Thick style */
    padding: 6px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 16px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.profile-stats {
    display: grid;
    grid-column: span 3;
    grid-row: 4;

    justify-content: space-around;
    /* Additional styles for the profile stats */

    font-variant: small-caps;
    font-weight: bold;  /* Thick style */
    padding: 12px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 18px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.profile-actions {
    display: grid;
    grid-column: span 3;
    grid-row: 5;

    /* Bottom border */
    border-bottom: 4px solid #666;
    border-top: 4px solid #666;
    border-radius: 2px;

    justify-content: space-around;
    /* Additional styles for the profile stats */

    font-variant: small-caps;
    font-weight: bold;  /* Thick style */
    padding: 12px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 18px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}


.profile-stats-cmd { 
    grid-column: 1;
    grid-row: 1;
}

.profile-stats-def { 
    grid-column: 2;
    grid-row: 1;
}

.profile-stats-save { 
    grid-column: 3;
    grid-row: 1;
}

.profile-stats-move { 
    grid-column: 1;
    grid-row: 2;
}

.profile-stats-shoot { 
    grid-column: 2;
    grid-row: 2;
}

.profile-stats-melee { 
    grid-column: 3;
    grid-row: 2;
}

.profile-special-abilities {
    grid-column: span 3;
    grid-row: 6;

    font-weight: bold;  /* Thick style */
    text-align: center;
    font-variant: small-caps;
    padding: 12px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 18px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.damage-chart {
    grid-column: span 3;
    grid-row: 7;

    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto auto; 

    /* Top border */
    border-top: 4px solid #666;
    border-radius: 2px;

    text-transform: uppercase;
    font-weight: bold;  /* Thick style */
    text-align: center;
    padding: 16px;
    background-color: transparent;  /* Light gray background for visibility */
    font-size: 24px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
}

.left-bar .profile-list-buttons {
    position: fixed;
    bottom: 0;
    width: auto;
}


/* MODAL STYLE */

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    font-weight: bold;  /* Thick style */
    padding: 16px;
    background-color: transparent;  /* Light gray background for visibility */
    text-align: center;
    font-size: 24px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: bold;
    font-variant: small-caps;
}

.modal-content button {
    border: none;
    text-decoration: none;
    font-size: 16px;
    font-family: inherit;
    margin: 12px 12px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

.modal-content button:hover {
    background-color: rgba(220, 220, 220, 0.5);
    transition: 0.7s;
}


.modal-header {
    text-transform: uppercase;
    border-bottom: 4px solid #666;
    border-radius: 2px;
    margin-bottom: 24px;
}

.modal-footer {
    text-transform: uppercase;
    margin-top: 24px;
    font-size: 16px;
    border-top: 4px solid #666;
    border-radius: 2px;
}


.right-bar-section {
    /* Bounding Box*/
    background-color: #f0f0f0; /* Light grey background */
    padding: 10px;
    margin: 20px 0;
    overflow-y: auto; /* If your list is long */

    /* Inside Fonts: */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; /* Consistent font */
    font-weight: bold;
    font-size: 18px;
    border: none; /* No borders */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    background-color: transparent;
    border: none;
    padding: 8px 12px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-symbol {
    font-size: 12px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f0f0f0;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

.dropdown-item:hover {
    background-color: #e0e0e0;
}

.dropdown-item.selected {
    background-color: #ddd;
    font-weight: bold;
}

.atw-weapon {
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.atw-weapon:hover {
    background-color: #fff;
}

.atw-weapon-name {
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-size: 14px;
    cursor: pointer;
}

.atw-weapon-options {
    font-size: 12px;
    text-transform: uppercase;
    padding-left: 20px;
}

.atw-action {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.atw-action:hover {
    background-color: #fff;
}

.atw-action-selected {
    background-color: #aaa; /* Light blue to indicate selection */
    cursor: not-allowed;
}

.atw-action-unavailable {
    color: #f66;
    cursor: not-allowed;
}

/* Style for the textbox */
.edit-form label {
    border: none; /* No borders */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; /* Consistent font */
    font-size: 16px;
    color: #333; /* Darker text for better readability */
    padding: 8px; /* Some padding inside the textbox */
}

.edit-form input[type="text"] {
    background-color: #f0f0f0; /* Light grey background */
    border: none; /* No borders */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; /* Consistent font */
    color: #333; /* Darker text for better readability */
    padding: 8px; /* Some padding inside the textbox */
    margin-bottom: 10px; /* Space below the textbox */
}

.right-bar .right-baarbutton {
    position: fixed;
    bottom: 0;
    width: auto;
}

/* Single action displaying */
.single-action-container {
    display: flex;
    align-items: center;
    justify-content: start; /* Changed to 'start' to align items to the left */
    margin-bottom: 10px;
    width: 100%;
}

.single-action-cost-boxes {
    display: flex;
}

.single-action-cost-box, .single-action-slot-box {
    width: 40px; /* Fixed size for square shape */
    height: 40px; /* Fixed size for square shape */
    border: 4px solid #666;
    border-radius: 2px;
    margin-right: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75em; /* Adjust font size as needed */
}

.single-action-details {
    flex-grow: 1;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers the text vertically */
}

.single-action-name {
    font-weight: bold;
    margin-bottom: 5px; /* Adds a little space between the name and the text */
}

.single-action-text {
    font-size: 0.9em;
}

.single-action-slot-box {
    /* The styles are now identical to .single-action-cost-box, so no need for duplicate properties */
}


/* CUSTOM CHECKBOX */

/* Hide the default checkbox but maintain its functionality */
.custom-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

/* Flexbox to align items and move checkbox to the right */
.custom-checkbox {
    display: flex;
    justify-content: space-between; /* Adjust content spacing */
    align-items: center; /* Center-align items vertically */
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
}

.custom-checkbox .checkmark {
    position: relative;
    height: 16px;
    width: 16px;
    background-color: #eee;
    border: 4px solid #333;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: "✔";
    position: absolute;
    left: 2px;
    top: -2px; /* Adjust for vertical alignment */
    font-size: 16px;
    color: #333;
}


/* HIDING IT FOR MOBILE */
/* Hide main content and display the mobile warning on small screens */
@media (max-width: 768px) {
    .app {
        display: none;
    }

    .mobile-warning {
        display: block;
        text-align: center;
        padding: 20px;
        font-size: 20px;
    }
}

/* Hide the mobile warning on larger screens */
@media (min-width: 769px) {
    .mobile-warning {
        display: none;
    }

    .app {
        display: grid;
    }
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px; /* Match canvas width */
    height: 560px; /* Match canvas height */
    margin: 20px auto;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-container canvas {
    width: 400px; /* Match canvas width */
    height: 560px; /* Match canvas height */
}

canvas {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4a90e2;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4a90e2;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    font-size: 1em;
    font-weight: bold;
    color: #333;
}

.view-mode-button {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}

.view-mode-button:hover {
    background-color: #e0e0e0;
}