/* ============================================
   TOSWeb Site Styles
   Built on Bootstrap 5.3.3
   ============================================ */

/* --- App Shell: Sidebar + Content Layout --- */

:root {
    --sidebar-width: 260px;
}

/* Fixed sidebar on desktop (xl+) */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 1040;
    background: #fff;
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    padding-top: 0;
    transition: transform 0.3s ease;
}

/* Push content to the right on xl+ when sidebar is visible */
@media (min-width: 1200px) {
    .app-main {
        margin-left: var(--sidebar-width);
    }
}

/* On smaller screens, hide the fixed sidebar — offcanvas takes over */
@media (max-width: 1199.98px) {
    .app-sidebar {
        display: none;
    }
}

/* Sidebar nav styling */
.sidebar-nav .nav-link {
    color: var(--bs-body-color);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bs-tertiary-bg);
}

.sidebar-nav .nav-link .nav-icon {
    display: inline-block;
    width: 1.5rem;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-nav .nav-link-text {
    vertical-align: middle;
}

.sidebar-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    padding: 1rem 1rem 0.25rem;
}

.sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.sidebar-brand img {
    max-height: 40px;
}

.sidebar-footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 0.5rem 0;
    margin-top: auto;
}

/* --- Stat Block (D&D Parchment Style) --- */

.stat-block {
    text-align: left;
    margin: 20px;
    display: inline-block;
    vertical-align: top;
    width: 17%;
    min-width: 280px;
    background: #FDF1DC;
    padding: 5px 10px 20px;
    box-shadow: 0 0 1.5em #867453;
    background-image: url('../images/statblockparch.jpg');
}

.stat-block.wide {
    width: 46.5%;
    min-width: 600px;
    max-width: 800px;
    text-align: left;
}

.stat-block.wide .section-left,
.stat-block.wide .section-right {
    display: inline-block;
    vertical-align: top;
    width: 48%;
    text-align: left;
}

.stat-block.wide .section-left {
    margin-right: 1.5%;
}

.stat-block.wide .section-right {
    margin-left: 1.5%;
}

@media screen and (max-width: 675px) {
    .stat-block.wide {
        min-width: 280px;
    }
    .stat-block.wide .section-left,
    .stat-block.wide .section-right {
        display: block;
        width: 100%;
        margin: 0;
    }
}

@media screen and (max-width: 700px) {
    .stat-block {
        margin: 20px 0;
    }
}

.orange-border {
    display: block;
    background: #E69A28;
    border: 1px solid #000;
    height: 5px;
    padding: 0 10px 0;
    margin: -10px -10px 0;
    box-sizing: initial;
    background-image: url('../images/statblockbar.jpg');
}

.orange-border.bottom {
    margin: 15px -10px -20px;
}

.tapered-rule {
    display: block;
    width: 100%;
    height: 5px;
    border: none;
    color: #922610;
    fill: #922610;
}

/* --- Creature / Character Heading --- */

.creature-heading h1 {
    font-family: 'Libre Baskerville', 'Lora', 'Calisto MT', 'Bookman Old Style', Bookman, 'Goudy Old Style', Garamond, 'Hoefler Text', 'Bitstream Charter', Georgia, serif;
    color: #922610;
    font-size: 23px;
    line-height: 1.2em;
    margin: 10px 0 0;
    letter-spacing: 1px;
    font-variant: small-caps;
    font-weight: bold;
}

.creature-heading h2 {
    font-weight: normal;
    font-style: italic;
    font-size: 14px;
    line-height: 1.2em;
    margin: 0 0 10px;
}

/* --- Stat Block Typography --- */

.property-line h4,
.property-line p {
    display: inline;
    margin: 0;
    color: #922610;
    font-size: 13.5px;
    line-height: 1.2em;
}

.property-line h4 {
    color: #7A200D;
    font-weight: bold;
}

.property-line {
    text-indent: -1em;
    padding-left: 1.1em;
    line-height: 1.4em;
}

.property-line.first {
    margin: 8px 0 0;
}

.property-line.last {
    margin: 0 0 10px;
}

.abilities {
    text-align: center;
    color: #922610;
}

.abilities > div {
    display: inline-block;
    vertical-align: middle;
    width: 15.5%;
    min-width: 40px;
    font-size: 12px;
    line-height: 1em;
}

.abilities h4 {
    margin: 10px 0 2px;
    font-size: 14px;
    line-height: 1.2em;
    text-transform: uppercase;
    color: #7A200D;
    font-weight: bold;
}

.abilities p {
    margin: 0 0 10px;
    line-height: 1.2em;
}

.property-block h4,
.property-block p {
    font-size: 13.5px;
    line-height: 1.2em;
    display: inline;
    margin: 0;
    color: black;
}

.property-block h4 {
    font-style: italic;
    font-weight: bold;
}

.property-block {
    padding: 10px 2px 0;
}

.actions h3 {
    border-bottom: 1px solid #7A200D;
    color: #7A200D;
    font-size: 21px;
    font-variant: small-caps;
    font-weight: normal;
    letter-spacing: 1px;
    margin: 20px 0 0;
    padding: 0 0 10px;
    text-indent: 5px;
}

.actions {
    margin: 0 0 20px;
}

.actions:last-child {
    margin: 0;
}

.i-line {
    padding-left: 15px;
    margin-right: -1px;
}

@media print {
    .orange-border {
        display: none;
    }
    .stat-block,
    .stat-block.wide,
    .stat-block.wide .section-left,
    .stat-block.wide .section-right,
    .property-line,
    .property-block {
        width: 100%;
        display: block;
    }
    .stat-block.wide .section-left,
    .stat-block.wide .section-right {
        margin: 0;
    }
    .stat-block {
        width: 40%;
        display: inline-block;
        vertical-align: top;
    }
    .stat-block.wide {
        page-break-after: always;
    }
}

/* --- Stat Block Page (text-based) --- */

div.statblock {
    width: 50%;
    min-width: 640px;
}

span.level {
    float: right;
    margin-right: 3px;
}

p.title {
    font-size: 18px;
    font-weight: bold;
    background-color: rgb(207, 226, 243);
    padding: 3px;
}

p.stat {
    margin: 0pt;
    padding-bottom: 20px;
}

p.divider {
    font-size: 12px;
    border-top: solid thin;
    border-bottom: solid thin;
    text-transform: uppercase;
}

/* --- Tables --- */

.hiddenRow {
    padding: 0 !important;
}

.spellPlanner tr:nth-child(4n+1),
.spellPlanner tr:nth-child(4n+2) {
    background-color: rgba(0, 0, 0, 0.05);
}

.table-striped2 tbody tr:nth-child(4n+1) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* --- Card Accent Borders (matching portal.css convention) --- */

.border-left-success {
    border-left: 0.25rem solid var(--bs-success) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--bs-info) !important;
}

.border-left-primary {
    border-left: 0.25rem solid var(--bs-primary) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--bs-warning) !important;
}

/* --- Dice Roller --- */

.die-roller-body .die {
    font-size: 24px;
    margin: 10px;
    padding: 10px;
}

/* --- Two-Column List --- */

.two-column-ul {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
}

/* --- Misc Overrides --- */

.blockquote-footer {
    margin-top: 3px;
}

input.btn:not([class*="btn-outline"]),
button.btn:not([class*="btn-outline"]) {
    color: white;
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

/* --- Character Sheet Redesign --- */

.ability-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .ability-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.ability-tile {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    text-align: center;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ability-tile:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

.ability-tile .ability-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.125rem;
}

.ability-tile .ability-mod {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--bs-body-color);
}

.ability-tile .ability-score {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.combat-highlight {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}

.combat-highlight .ch-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 3rem;
    text-align: center;
}

.combat-highlight .ch-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.combat-highlight .ch-detail {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.save-row {
    display: flex;
    gap: 0.5rem;
}

.save-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.save-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

.save-item .save-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.save-item .save-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.cs-section {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.cs-section-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.cs-section-body {
    padding: 0.75rem;
}

.cs-section .table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.cs-section .table th,
.cs-section .table td {
    padding: 0.35rem 0.5rem;
}

.info-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    background: var(--bs-tertiary-bg);
    border-radius: 1rem;
    white-space: nowrap;
}

.info-pill strong {
    font-weight: 600;
}

/* --- Auth Page Backgrounds --- */

.bg-login-image {
    background: url("/images/login-image.png");
    background-position: center;
    background-size: cover;
}

.bg-register-image {
    background: url("/images/register-image.png");
    background-position: center;
    background-size: cover;
}

.bg-password-image {
    background: url("/images/password-image.png");
    background-position: center;
    background-size: cover;
}

/* --- User Profile Image --- */

.app-user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
