@import url('master.css');

/***** Custom lightweight framework — replaces Bootstrap. *****
 * Provides the grid, utility classes, and components (navbar, buttons,
 * jumbotron, list-group, table, modal, forms) the views rely on, themed
 * via the CSS variables in master.css (light/dark).
 */

/* ----- Reset / base ----- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: var(--theme-transition);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--heading-color);
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--panel-border-color);
    transition: var(--theme-transition);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover {
    color: var(--accent-hover-color);
    text-decoration: underline;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
}

label {
    display: inline-block;
    margin-bottom: .5rem;
}

img {
    max-width: 100%;
}

/* ----- Grid ----- */
.container, .container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.row > [class*="col"] {
    padding-right: 15px;
    padding-left: 15px;
    width: 100%;
}

.col-md-8 {
    width: 100%;
}

@media (min-width: 768px) {
    .col-md {
        flex-basis: 0;
        flex-grow: 1;
        max-width: 100%;
        width: auto;
    }
    .col-md-8 {
        width: 66.66667%;
    }
}

.mx-auto {
    margin-right: auto !important;
    margin-left: auto !important;
}

/* ----- Spacing utilities ----- */
.m-0 { margin: 0 !important; }
.m-1 { margin: .25rem !important; }
.m-2 { margin: .5rem !important; }

.p-2 { padding: .5rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pl-3 { padding-left: 1rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ml-5 { margin-left: 3rem !important; }
.ml-auto { margin-left: auto !important; }

.mr-2 { margin-right: .5rem !important; }
.mr-auto { margin-right: auto !important; }

@media (max-width: 575.98px) {
    .ml-5 { margin-left: 1.5rem !important; }
    .p-4 { padding: 1rem !important; }
    .p-5 { padding: 1.5rem !important; }
    .mt-5 { margin-top: 1.75rem !important; }
    .mb-5 { margin-bottom: 1.75rem !important; }
}

/* ----- Text utilities ----- */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-white { color: #fff !important; }
.text-muted { color: var(--text-muted-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-italic { font-style: italic !important; }
small, .small { font-size: 80%; font-weight: 400; }

/* ----- Display utilities ----- */
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-start { justify-content: flex-start !important; }
.align-items-center { align-items: center !important; }
.float-right { float: right !important; }
.w-100 { width: 100% !important; }
.rounded { border-radius: var(--control-border-radius) !important; }
.rounded-0 { border-radius: 0 !important; }

/* ----- Colors ----- */
.bg-dark { background-color: var(--ink-color) !important; }
.bg-light { background-color: var(--panel-alt-color) !important; }
.bg-primary { background-color: var(--accent-color) !important; }

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .5rem .9rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--control-border-radius);
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    color: #fff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    color: #fff;
    background-color: var(--accent-hover-color);
    border-color: var(--accent-hover-color);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: transparent;
}
.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.btn-success {
    color: #fff;
    background-color: var(--success-color);
    border-color: var(--success-color);
    box-shadow: var(--shadow-sm);
}
.btn-success:hover {
    color: #fff;
    filter: brightness(1.08);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: .6rem 1.1rem;
    font-size: 1.25rem;
    border-radius: var(--control-border-radius);
}

.close {
    padding: 0;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-color);
    opacity: .5;
    cursor: pointer;
}
.close:hover { opacity: .75; }

/* ----- Theme toggle ----- */
.theme-toggle {
    position: fixed;
    right: 1.25rem;
    bottom: calc(60px + 1rem); /* clear the sticky footer bar */
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--panel-border-color);
    background-color: var(--panel-color);
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    transition: var(--theme-transition), transform .2s ease, box-shadow .15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    transform: rotate(15deg) scale(1.05);
    box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft-color);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

/* ----- Navbar ----- */
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1.25rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 16px rgba(0, 0, 0, .25);
}

.navbar-dark .navbar-toggler {
    color: var(--ink-text-color);
    border-color: rgba(255, 255, 255, .15);
}

.navbar-toggler {
    padding: .25rem .75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--control-border-radius);
    cursor: pointer;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.82)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.navbar-nav .nav-link {
    position: relative;
    color: var(--ink-text-color);
    padding: .6rem .9rem;
    display: block;
    text-decoration: none;
    border-radius: var(--control-border-radius);
    transition: color .15s ease, background-color .15s ease;
}
.navbar-nav .nav-link:hover {
    color: var(--ink-text-hover-color);
    background-color: rgba(255, 255, 255, .08);
}

.collapse:not(.show) {
    display: none;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

@media (min-width: 768px) {
    .navbar-expand-md {
        flex-flow: row nowrap;
        justify-content: flex-start;
    }
    .navbar-expand-md .navbar-nav {
        flex-direction: row;
    }
    .navbar-expand-md .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
    .navbar-expand-md .navbar-toggler {
        display: none;
    }
}

.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

/* ----- Jumbotron ----- */
.jumbotron {
    position: relative;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background-color: var(--panel-alt-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.jumbotron.bg-honeycomb::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 12, 18, .55), rgba(10, 12, 18, .8));
    pointer-events: none;
}

.jumbotron > * {
    position: relative;
}

@media (min-width: 576px) {
    .jumbotron {
        padding: 4rem 2rem;
    }
}

.display-4 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.display-5 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
}

@media (max-width: 575.98px) {
    .display-4 { font-size: 2.25rem; }
    .display-5 { font-size: 1.75rem; }
}

/* ----- List group ----- */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-group-item {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .85rem 1.25rem;
    background-color: var(--panel-color);
    border: 1px solid var(--panel-border-color);
    color: var(--text-color);
    transition: var(--theme-transition);
}

.list-group-item + .list-group-item {
    border-top-width: 0;
}

/* ----- Table ----- */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-collapse: collapse;
}

.table td, .table th {
    padding: .75rem;
    vertical-align: top;
    border-top: 1px solid var(--panel-border-color);
}

.thead-light th {
    background-color: var(--panel-alt-color);
    border-color: var(--panel-border-color);
}

/* ----- Forms ----- */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--panel-color);
    border: 1px solid var(--panel-border-color);
    border-radius: var(--control-border-radius);
    transition: var(--theme-transition), border-color .15s ease;
}

/* ----- Modal ----- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background-color: rgba(8, 9, 12, .6);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 500px;
    margin: 1.75rem auto;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    outline: 0;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--panel-border-color);
}

.modal-title {
    margin-bottom: 0;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: .75rem;
    border-top: 1px solid var(--panel-border-color);
}
