/* Family newlook tokens and components, without Bootstrap.
   Measurements follow docs/bigbang-style-guide.html. */

:root {
    --fam-deepnavy: #11185F;
    --fam-main-background: #F9F0E7;
    --fam-whitesmoke: #F5F5F5;
    --fam-litebronze: #fbeedf;
    --fam-bronze: #7a6841;
    --fam-purple: #71408E;
    --fam-periwinkle-light: #E8E8FF;
    --fam-periwinkle: #CCCCFF;
    --fam-lightGrey: #CDCDCD;
    --fam-slategrey: #708090;
    --fam-gold: #FFD700;
}

* { box-sizing: border-box; }

html { font-size: 14px; }

[hidden] { display: none !important; }

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--fam-main-background);
    color: #000;
    font-family: fira-sans, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.page-top { width: 100%; }

.new-page-titlebar {
    background: var(--fam-litebronze);
    color: var(--fam-deepnavy);
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    padding: 0.85rem 1rem;
    line-height: 1.3;
}

hr {
    border: 0;
    border-top: 2px solid var(--fam-deepnavy);
    margin: 0;
    width: 100%;
}

.page-section {
    padding: 1.15rem 0 3rem;
}

.page-wrap {
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.tabs-style {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 1.5rem;
}

.tab-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fam-deepnavy);
    background: var(--fam-whitesmoke);
    border: 1px solid var(--fam-deepnavy);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
}

.tab-link:hover {
    background: var(--fam-purple);
    border-color: var(--fam-purple);
    color: #fff;
}

.tab-link.active {
    background: var(--fam-deepnavy);
    border-color: var(--fam-deepnavy);
    color: var(--fam-whitesmoke);
}

.tab-link.active:hover {
    background: var(--fam-purple);
    border-color: var(--fam-purple);
    color: #fff;
}

.page-wrap > h2.form-headings:first-of-type { margin-top: 0.25rem; }

h2.form-headings {
    margin: 2rem 0 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    color: var(--fam-deepnavy);
}

.page-section p,
.page-section li,
.page-section td {
    color: #000;
}

.section-meta,
.library-meta,
.meta {
    margin: 0.4rem 0 0;
    font-size: 0.9em;
    font-style: italic;
    color: #000;
}

.row { margin: 0.9rem 0; }

button,
.btn {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--fam-deepnavy);
    background: var(--fam-whitesmoke);
    border: 1px solid var(--fam-deepnavy);
    border-radius: 4px;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    line-height: 1.2;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    background: var(--fam-purple);
    border-color: var(--fam-purple);
    color: #fff;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-newlook-2 {
    padding: 0.3rem 0.55rem;
}

.btn-newlook-3 {
    background: var(--fam-slategrey);
    border-color: var(--fam-slategrey);
    color: #fff;
}

.btn-newlook-primary {
    background: var(--fam-deepnavy);
    border-color: var(--fam-deepnavy);
    border-radius: 6px;
    color: #fff;
}

.btn-newlook-primary-submit {
    background: var(--fam-deepnavy);
    border-color: var(--fam-deepnavy);
    color: #fff;
    font-size: 1rem;
    padding: 0.6rem 1.35rem;
}

.btn-newlook-primary:hover:not(:disabled),
.btn-newlook-primary-submit:hover:not(:disabled),
.btn-newlook-3:hover:not(:disabled) {
    background: var(--fam-purple);
    border-color: var(--fam-purple);
    color: #fff;
}

.btn-newlook-primary-cancel {
    background: var(--fam-slategrey);
    border-color: var(--fam-slategrey);
    color: #fff;
}

.btn-newlook-primary-cancel:hover:not(:disabled) {
    background: var(--fam-lightGrey);
    border-color: var(--fam-lightGrey);
    color: #000;
}

label { font-weight: 600; }

.form-label,
.modal-field label {
    display: block;
    margin-bottom: 0.35rem;
    color: #000;
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    background: var(--fam-whitesmoke);
    color: #000;
    border: 1px solid var(--fam-slategrey);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    font: inherit;
    font-size: 0.95rem;
    height: 2rem;
    padding: 0 0.55rem;
}

textarea {
    height: auto;
    padding: 0.45rem 0.55rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
}

input[type="checkbox"],
input[type="range"] {
    accent-color: var(--fam-deepnavy);
}

.input-narrow { width: 4.5rem; }

.scrub-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.scrub-row input[type="range"] { flex: 1; min-width: 140px; }
.scrub-label { min-width: 3.5rem; }

.library-toolbar,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    margin-top: 0.35rem;
}

.library-toolbar input[type="search"],
.toolbar input[type="search"] {
    flex: 1;
    min-width: 180px;
}

.library-scroll {
    max-height: 520px;
    overflow-x: hidden;
    overflow-y: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--fam-deepnavy);
    border-radius: 4px;
    background: #fff;
}

table.table-newlook {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    margin: 0;
}

.table-newlook th,
.table-newlook td {
    text-align: left;
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--fam-lightGrey);
    font-size: 13px;
    line-height: 1.3;
}

.table-newlook th:nth-child(1),
.table-newlook td:nth-child(1) { width: 4.5rem; }

.table-newlook th:nth-child(3),
.table-newlook td:nth-child(3) { width: 5.5rem; }

.table-newlook th:nth-child(4),
.table-newlook td:nth-child(4) { width: 9rem; }

.table-newlook th:nth-child(2),
.table-newlook td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-newlook th {
    background: var(--fam-bronze);
    color: #fff;
    font-weight: 600;
}

.table-newlook tbody tr:nth-child(odd) { background: var(--fam-whitesmoke); }
.table-newlook tbody tr:nth-child(even) { background: var(--fam-litebronze); }
.table-newlook tbody tr:hover { background: var(--fam-lightGrey); }

.library-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable .sort-ind { color: var(--fam-whitesmoke); font-size: 0.75rem; margin-left: 0.25rem; }
th.sortable.sorted .sort-ind { color: #fff; }

td.actions {
    width: 24rem;
    white-space: nowrap;
    overflow: hidden;
}

td.actions button {
    display: inline-block;
    margin: 0 0.25rem 0 0;
    padding: 0.2rem 0.4rem;
    font-size: 11px;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
}

td.actions button:last-child { margin-right: 0; }

img.thumb-preview {
    width: 60px;
    height: 34px;
    object-fit: cover;
    display: block;
    background: #000;
    border: 1px solid var(--fam-deepnavy);
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--fam-periwinkle-light);
    color: var(--fam-deepnavy);
    border: 1px solid var(--fam-deepnavy);
}

.badge-no {
    background: var(--fam-litebronze);
    color: var(--fam-bronze);
    border-color: var(--fam-bronze);
}

.badge-conv {
    background: var(--fam-periwinkle);
    color: var(--fam-deepnavy);
    border-color: var(--fam-deepnavy);
}

.library-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

#videoPlayer {
    width: 100%;
    max-height: 500px;
    display: block;
    background: #000;
    border: 1px solid var(--fam-deepnavy);
    border-radius: 4px;
}

#previewArea {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--fam-whitesmoke);
    border: 1px solid #000;
    border-radius: 4px;
}

#previewArea h3 {
    margin: 0 0 0.5rem;
    color: var(--fam-deepnavy);
    font-size: 1.1rem;
    font-weight: 600;
}

#previewImg {
    max-width: 320px;
    display: block;
    margin: 0.6rem 0 0.8rem;
    border: 1px solid var(--fam-deepnavy);
}

#statusMsg,
#uploadStatus,
#convertStatus {
    margin-top: 0.65rem;
    font-weight: 600;
}

.ok { color: var(--fam-deepnavy); }
.err { color: var(--fam-bronze); }

#progressOuter,
#convertProgressOuter {
    background: var(--fam-whitesmoke);
    border: 1px solid var(--fam-lightGrey);
    border-radius: 4px;
    height: 0.7rem;
    overflow: hidden;
    margin-top: 0.5rem;
    display: none;
}

#progressInner,
#convertProgressInner {
    background: var(--fam-deepnavy);
    height: 100%;
    width: 0;
}

.modal-overlay,
.player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(17, 24, 95, 0.55);
}

.modal-overlay.open,
.player-overlay.open { display: flex; }

.modal-box {
    width: min(36rem, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #fff;
    color: #000;
    border: 1px solid var(--fam-deepnavy);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(17, 24, 95, 0.28);
}

.modal-header,
.player-header {
    background: var(--fam-deepnavy);
    color: #fff;
    padding: 0.85rem 1.15rem;
}

.modal-title,
.player-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: none;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.player-header h2 { word-break: break-word; }

.modal-body { padding: 1rem 1.15rem 1.15rem; }

.modal-field { margin-bottom: 1rem; }

.field-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.field-row input,
.field-row textarea { flex: 1; min-width: 0; }

.modal-field textarea { min-height: 5.5rem; font-family: Consolas, "Courier New", monospace; font-size: 0.8rem; }
.copy-btn { flex-shrink: 0; align-self: flex-start; }
.player-header .btn-newlook-1 { flex-shrink: 0; }

.modal-note {
    font-size: 0.85rem;
    color: var(--fam-bronze);
    margin: 0 0 0.9rem;
}

.modal-close-row { text-align: right; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

button.card {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    text-transform: none;
    font-weight: 400;
    font-size: inherit;
    letter-spacing: normal;
    color: #000;
    background: #fff;
    border: 1px solid var(--fam-deepnavy);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(17, 24, 95, 0.12);
}

button.card:hover:not(:disabled),
button.card:focus-visible {
    background: #fff;
    color: #000;
    border-color: var(--fam-purple);
    box-shadow: 0 2px 10px rgba(113, 64, 142, 0.2);
}

button.card:disabled {
    opacity: 0.75;
    cursor: default;
}

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-thumb .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fam-whitesmoke);
    font-size: 0.8rem;
    background: var(--fam-deepnavy);
}

.card-thumb .play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card:hover .play,
.card:focus-visible .play { background: rgba(17, 24, 95, 0.28); }

.card-thumb .play span {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--fam-whitesmoke);
    color: var(--fam-deepnavy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding-left: 3px;
}

.grid .card-body {
    padding: 0.65rem 0.75rem 0.75rem;
    background: var(--fam-whitesmoke);
    border-top: 1px solid var(--fam-deepnavy);
}

.grid .card-title {
    color: var(--fam-deepnavy);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.grid .card-sub {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #000;
}

.grid .badge-conv { margin-top: 0.4rem; }

.player-box {
    width: min(960px, 100%);
    background: #000;
    border: 1px solid var(--fam-deepnavy);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(17, 24, 95, 0.35);
}

.player-box video {
    width: 100%;
    max-height: 75vh;
    display: block;
    background: #000;
}

@media (min-width: 500px) {
    .page-wrap { max-width: 1140px; }
}

@media (min-width: 1200px) {
    .new-page-titlebar { background: transparent; }
}
