/*
 * Law Hours Log  –  Rosewood Ridge RP
 * Design system: mirrors Jail Command Builder
 */

@import url('variables.css');

/* ── Page wrapper ─────────────────────────────────────────── */
.lh-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.lh-hero {
    text-align: center;
    margin-bottom: 2rem;
    animation: lh-fadein 0.5s ease both;
}

.lh-hero h1 {
    font-size: 2.1rem;
    font-weight: 700;
    background: linear-gradient(120deg, var(--text-color) 40%, var(--highlight-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.lh-hero p {
    color: var(--text-secondary-color);
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.85;
}

/* ── Tab bar ──────────────────────────────────────────────── */
.lh-tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.lh-tab-btn {
    flex: 1;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(151, 64, 38, 0.35);
    background: var(--input-bg);
    color: var(--text-secondary-color);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lh-tab-btn:hover {
    border-color: var(--highlight-color);
    color: var(--text-color);
}

.lh-tab-btn.active {
    background: linear-gradient(135deg, var(--highlight-color), #7a3520);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(151, 64, 38, 0.35);
}

/* ── Card ─────────────────────────────────────────────────── */
.lh-card {
    background: var(--gradient-dark);
    border: 1px solid rgba(151, 64, 38, 0.4);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-std), 0 0 40px rgba(151, 64, 38, 0.08);
    padding: 2rem 2.25rem;
    position: relative;
    overflow: hidden;
    animation: lh-fadein 0.55s ease both;
}

.lh-card--wide {
    max-width: 100%;
}

/* shimmer top border */
.lh-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--highlight-color) 40%,
        var(--text-secondary-color) 60%,
        transparent 100%);
    opacity: 0.6;
}

/* ── Steps grid ───────────────────────────────────────────── */
.lh-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.75rem;
}

.lh-step { animation: lh-slideup 0.4s ease both; }
.lh-step.lh-full { grid-column: 1 / -1; }

/* ── Labels ───────────────────────────────────────────────── */
.lh-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary-color);
    margin-bottom: 0.35rem;
}

.lh-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--highlight-color), #7a3520);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    padding: 0 4px;
}

/* ── Inputs ───────────────────────────────────────────────── */
.lh-select,
.lh-input {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid rgba(151, 64, 38, 0.45);
    border-radius: 8px;
    padding: 0.72rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.45);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.lh-select:focus,
.lh-input:focus {
    border-color: var(--highlight-color);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.45), 0 0 0 2px rgba(204, 116, 89, 0.18);
    background-color: rgba(35,35,35,0.95);
}

.lh-input[readonly] {
    opacity: 0.7;
    cursor: default;
}

/* custom select arrow */
.lh-select-wrap { position: relative; }
.lh-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--highlight-color);
    pointer-events: none;
}

/* textarea */
.lh-textarea {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid rgba(151, 64, 38, 0.45);
    border-radius: 8px;
    padding: 0.72rem 1rem;
    font-size: 0.92rem;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    resize: vertical;
    min-height: 120px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.45);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.lh-textarea:focus {
    border-color: var(--highlight-color);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.45), 0 0 0 2px rgba(204, 116, 89, 0.18);
}

/* hint text */
.lh-hint {
    font-size: 0.75rem;
    color: var(--text-secondary-color);
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* ── Divider ──────────────────────────────────────────────── */
.lh-divider {
    border: none;
    border-top: 1px solid rgba(151, 64, 38, 0.25);
    margin: 1.6rem 0 1.4rem;
}

/* ── Submit row ───────────────────────────────────────────── */
.lh-submit-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lh-submit-btn,
.lh-reset-btn {
    padding: 0.75rem 1.9rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.lh-submit-btn {
    background: linear-gradient(135deg, var(--highlight-color), #7a3520);
    color: #fff;
    box-shadow: 0 2px 12px rgba(151, 64, 38, 0.4);
}
.lh-submit-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.lh-submit-btn:active { filter: brightness(0.95); transform: translateY(0); }

.lh-reset-btn {
    background: var(--input-bg);
    color: var(--text-secondary-color);
    border: 1px solid rgba(151, 64, 38, 0.3);
}
.lh-reset-btn:hover { border-color: var(--highlight-color); color: var(--text-color); }

/* ── Notices ──────────────────────────────────────────────── */
.lh-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}
.lh-notice.success {
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.4);
    color: #6fcf97;
}
.lh-notice.error {
    background: rgba(235, 77, 75, 0.1);
    border: 1px solid rgba(235, 77, 75, 0.4);
    color: #ff8080;
}
.lh-notice-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.lh-error-list { margin: 0; padding-left: 1.2rem; list-style: disc; }
.lh-error-list li { margin-bottom: 0.2rem; }

/* ── Logs table toolbar ───────────────────────────────────── */
.lh-logs-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.lh-search-wrap { flex: 1; min-width: 200px; }
.lh-filter-wrap .lh-label { margin-bottom: 0; text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
.lh-checkbox { accent-color: var(--highlight-color); width: 1rem; height: 1rem; cursor: pointer; }

.lh-refresh-btn {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(151, 64, 38, 0.4);
    background: var(--input-bg);
    color: var(--text-secondary-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.lh-refresh-btn:hover { border-color: var(--highlight-color); color: var(--text-color); }

/* ── Table ────────────────────────────────────────────────── */
.lh-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(151, 64, 38, 0.3);
}

.lh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--text-color);
}

.lh-table thead th {
    background: rgba(151, 64, 38, 0.18);
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary-color);
    user-select: none;
    border-bottom: 1px solid rgba(151, 64, 38, 0.3);
    white-space: nowrap;
}

.lh-table thead th.sortable { cursor: pointer; }
.lh-table thead th.sortable:hover { color: var(--text-color); }
.lh-table thead th.sort-asc  .sort-icon::after { content: ' ▲'; }
.lh-table thead th.sort-desc .sort-icon::after { content: ' ▼'; }
.sort-icon { font-size: 0.7rem; opacity: 0.6; }

.lh-table tbody tr {
    border-bottom: 1px solid rgba(151, 64, 38, 0.12);
    transition: background 0.15s;
}
.lh-table tbody tr:hover { background: rgba(151, 64, 38, 0.07); }
.lh-table tbody tr.lh-row-reviewed { opacity: 0.6; }

.lh-table td {
    padding: 0.7rem 0.9rem;
    vertical-align: top;
}

.lh-cell-date  { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lh-cell-name  { font-weight: 600; white-space: nowrap; }
.lh-cell-disc  { white-space: nowrap; }
.lh-cell-sub   { font-size: 0.8rem; color: var(--text-secondary-color); white-space: nowrap; }

.lh-duty-pill {
    display: inline-block;
    background: rgba(151, 64, 38, 0.15);
    border: 1px solid rgba(151, 64, 38, 0.25);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
    font-size: 0.78rem;
    color: var(--text-color);
}

/* Status badges */
.lh-badge-reviewed {
    display: inline-block;
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.35);
    color: #6fcf97;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
}
.lh-badge-pending {
    display: inline-block;
    background: rgba(243, 156, 18, 0.12);
    border: 1px solid rgba(243, 156, 18, 0.35);
    color: #f3c57a;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Mark reviewed button */
.lh-mark-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.1);
    color: #6fcf97;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.lh-mark-btn:hover { background: rgba(39, 174, 96, 0.2); border-color: rgba(39, 174, 96, 0.7); }
.lh-mark-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* loading / empty states */
.lh-loading, .lh-empty-cell, .lh-error-cell {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary-color);
    font-style: italic;
}
.lh-error-cell { color: #ff8080; }

/* Table footer */
.lh-table-footer {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary-color);
    text-align: right;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes lh-fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lh-slideup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .lh-steps   { grid-template-columns: 1fr; }
    .lh-card    { padding: 1.4rem 1.1rem; }
    .lh-hero h1 { font-size: 1.65rem; }
    .lh-submit-btn, .lh-reset-btn { width: 100%; text-align: center; }
    .lh-logs-toolbar { gap: 0.6rem; }
}

/* ── Estimated time row (form) ────────────────────────────── */
.lh-time-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lh-time-sel {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

.lh-time-sep {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary-color);
    flex-shrink: 0;
    padding-top: 2px;
}

/* ── Time cell in View Logs ───────────────────────────────── */
.lh-cell-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

/* ── Time Summary toolbar ─────────────────────────────────── */
.lh-ts-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.lh-ts-period-btns {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.lh-ts-period-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(151, 64, 38, 0.35);
    background: var(--input-bg);
    color: var(--text-secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lh-ts-period-btn:hover {
    border-color: var(--highlight-color);
    color: var(--text-color);
}

.lh-ts-period-btn.active {
    background: linear-gradient(135deg, var(--highlight-color), #7a3520);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(151, 64, 38, 0.35);
}

/* ── Period nav (prev / label / next) ─────────────────────── */
.lh-ts-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lh-ts-nav-btn {
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(151, 64, 38, 0.4);
    background: var(--input-bg);
    color: var(--text-secondary-color);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    line-height: 1;
}

.lh-ts-nav-btn:hover {
    border-color: var(--highlight-color);
    color: var(--text-color);
}

.lh-ts-period-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 160px;
    text-align: center;
    white-space: nowrap;
}

/* ── Monthly banner ───────────────────────────────────────── */
.lh-ts-month-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(151, 64, 38, 0.08);
    border: 1px solid rgba(151, 64, 38, 0.3);
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.lh-ts-note-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.lh-ts-note-tag {
    display: inline-block;
    background: rgba(204, 116, 89, 0.18);
    border: 1px solid rgba(204, 116, 89, 0.4);
    color: var(--highlight-color);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* ── Quota rows (≥10 hrs/month = green) ───────────────────── */
.lh-ts-row-quota {
    background: rgba(39, 174, 96, 0.07) !important;
    border-left: 3px solid rgba(39, 174, 96, 0.55);
}

.lh-ts-row-quota:hover {
    background: rgba(39, 174, 96, 0.12) !important;
}

.lh-cell-time--quota {
    color: #6fcf97 !important;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 640px) {
    .lh-ts-toolbar        { gap: 0.5rem; }
    .lh-ts-period-label   { min-width: 120px; font-size: 0.82rem; }
    .lh-time-sel          { max-width: 100%; }
}
