/*
 * 4ID Tactical Operations — Forumify theme
 * Designed to remain compatible with core Forumify and MILHQ components.
 */

:root {
    --fourth-header-start: #101b13;
    --fourth-header-end: #273c2b;
    --fourth-gold: #c9a85f;
    --fourth-gold-soft: rgba(201, 168, 95, 0.18);
    --fourth-green-soft: rgba(40, 76, 54, 0.12);
    --fourth-shadow: 0 18px 45px rgba(21, 31, 24, 0.10), 0 2px 8px rgba(21, 31, 24, 0.07);
    --fourth-shadow-hover: 0 20px 48px rgba(21, 31, 24, 0.15), 0 4px 12px rgba(21, 31, 24, 0.09);
}

html {
    color-scheme: light dark;
    scroll-behavior: smooth;
}

body {
    position: relative;
    letter-spacing: -0.01em;
    background-image:
        radial-gradient(circle at 8% 8%, var(--fourth-green-soft), transparent 27rem),
        radial-gradient(circle at 92% 82%, var(--fourth-gold-soft), transparent 32rem),
        repeating-linear-gradient(135deg, transparent 0, transparent 31px, rgba(91, 112, 96, 0.035) 32px);
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.32;
    background-image:
        linear-gradient(rgba(68, 91, 73, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(68, 91, 73, 0.055) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

::selection {
    color: #11180f;
    background: #d9bf79;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: var(--c-elevation-0);
}

::-webkit-scrollbar-thumb {
    border: 3px solid var(--c-elevation-0);
    border-radius: 999px;
    background: var(--c-secondary);
}

.header {
    position: sticky;
    top: 0;
    z-index: 700;
    margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
    color: #f7f5ec;
    border: 0;
    border-bottom: 1px solid rgba(230, 218, 176, 0.24);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 44%),
        linear-gradient(92deg, var(--fourth-header-start), var(--fourth-header-end));
    box-shadow: 0 10px 32px rgba(4, 10, 6, 0.24);
}

.header::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -3px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 3%, var(--fourth-gold) 20%, #e2cd91 50%, var(--fourth-gold) 80%, transparent 97%);
    opacity: 0.9;
}

.header .responsive {
    min-height: 64px;
}

.header a,
.header .btn-link,
.header-logo {
    color: #f7f5ec;
}

.header a:hover,
.header .btn-link:hover,
.header-logo:hover {
    color: #f1d789;
    background-color: rgba(255, 255, 255, 0.07);
}

.header-logo {
    min-width: max-content;
    padding: 0.55rem 0.75rem 0.55rem 0;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.header-logo img {
    width: 42px;
    height: 42px;
    padding: 4px;
    border: 1px solid rgba(229, 210, 149, 0.42);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}

.header-navigation {
    gap: 0.25rem;
}

.header nav a {
    padding: 0.7rem 0.85rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

main.responsive {
    min-height: calc(100vh - 185px);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.025em;
}

h1 {
    position: relative;
    padding-bottom: 0.7rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 74px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-call-to-action));
}

a {
    text-underline-offset: 3px;
}

.box,
.card,
.table-wrapper {
    border: var(--border);
    box-shadow: var(--fourth-shadow);
}

.box,
.card {
    position: relative;
    overflow: hidden;
}

.box::after,
.card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 3px;
    background: var(--c-call-to-action);
    opacity: 0.75;
}

.card-title {
    min-height: 48px;
    align-items: center;
    border-bottom-color: var(--border-color);
    background: linear-gradient(90deg, var(--fourth-green-soft), transparent 70%);
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.card-footer {
    background: var(--c-elevation-2);
}

.forum-list > .box,
.forum-list > .card,
.topic-row,
.thread-row,
.menu a,
.tablist a,
.tablist button {
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.forum-list > .box:hover,
.forum-list > .card:hover {
    transform: translateY(-2px);
    border-color: var(--c-primary-accent);
    box-shadow: var(--fourth-shadow-hover);
}

.topic-row {
    border-left: 3px solid transparent;
}

.topic-row:hover {
    border-left-color: var(--c-call-to-action);
}

.comment {
    border-left: 3px solid var(--c-primary);
}

.comment .comment-author {
    background: linear-gradient(145deg, var(--fourth-green-soft), transparent 74%);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    border: var(--border);
    border-radius: 5px;
    background: color-mix(in srgb, var(--c-elevation-1) 90%, transparent);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

select,
textarea,
input,
.ts-control {
    border-radius: 5px;
    border-color: var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

select:hover,
select:focus,
textarea:hover,
textarea:focus,
input:hover,
input:focus,
.ts-wrapper.focus .ts-control {
    border-color: var(--c-call-to-action);
    box-shadow: 0 0 0 3px var(--fourth-gold-soft);
}

input[type='checkbox'],
input[type='radio'] {
    accent-color: var(--c-primary);
}

.btn-primary,
.btn-cta,
.btn-outlined,
.btn-outlined-highlighted {
    min-height: 40px;
    border-radius: var(--button-border-radius);
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    box-shadow: 0 5px 12px rgba(21, 31, 24, 0.10);
}

.btn-primary {
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%);
}

.btn-primary:hover,
.btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(21, 31, 24, 0.18);
}

.btn-link {
    font-weight: 600;
}

.menu {
    overflow: hidden;
    border: var(--border);
    border-radius: 6px;
    box-shadow: var(--fourth-shadow-hover);
}

.menu .btn-link,
.menu a {
    border-left: 3px solid transparent;
}

.menu .btn-link:hover,
.menu .btn-link.active,
.menu a:hover {
    border-left-color: var(--c-call-to-action);
}

.tablist {
    padding: 0.35rem;
    border: var(--border);
    border-radius: 7px;
    background: var(--c-elevation-1);
}

.tablist .active {
    color: var(--c-primary-text);
    background: var(--c-primary);
}

.table-wrapper {
    overflow: hidden;
    border-radius: var(--border-radius);
}

table {
    border-radius: 0;
}

thead {
    color: #f7f5ec;
    border-bottom: 2px solid var(--c-call-to-action);
    background: linear-gradient(92deg, var(--fourth-header-start), var(--fourth-header-end));
}

thead th {
    height: 46px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

tbody tr:nth-child(even) {
    background-color: var(--fourth-green-soft);
}

tbody tr:not(.disabled):hover {
    background-color: var(--fourth-gold-soft);
}

tbody td {
    height: 48px;
    border-bottom: 1px solid var(--border-color);
}

.tag {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.alert-success,
.alert-info,
.alert-warning,
.alert-error {
    border: 1px solid currentColor;
    border-left-width: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.auth-container {
    max-width: 440px;
    margin-top: clamp(4rem, 10vh, 8rem);
}

.auth-container > .box:not(.auth-website-logo) {
    padding: clamp(1.35rem, 4vw, 2.25rem);
    border-top: 3px solid var(--c-call-to-action);
}

.auth-container > .box:not(.auth-website-logo)::before {
    content: 'SECURE PERSONNEL ACCESS';
    display: block;
    margin-bottom: 0.4rem;
    color: var(--c-text-secondary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-align: center;
}

.auth-website-logo {
    width: 116px;
    height: 116px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(205, 179, 108, 0.48);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, var(--fourth-header-start), var(--fourth-header-end));
    box-shadow: 0 18px 40px rgba(4, 10, 6, 0.25);
}

.auth-website-logo::after {
    display: none;
}

.auth-website-logo img {
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.34));
}

.auth-container h2 {
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.avatar {
    border: 2px solid var(--c-elevation-1);
    outline: 1px solid var(--border-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.dot {
    box-shadow: 0 0 0 4px var(--fourth-gold-soft);
}

.upload-zone,
.file-upload {
    border-radius: var(--border-radius);
    background: var(--fourth-green-soft);
}

.modal > div,
.profile-preview,
.ts-dropdown {
    border: var(--border);
    box-shadow: var(--fourth-shadow-hover);
}

footer {
    position: relative;
    margin-top: 4rem;
    padding: 1.5rem 1rem;
    color: #aeb9b0;
    border-top: 1px solid rgba(230, 218, 176, 0.18);
    background: linear-gradient(92deg, var(--fourth-header-start), var(--fourth-header-end));
}

footer a {
    color: #dfc77d;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 767px) {
    .header {
        margin-bottom: 1.5rem;
    }

    .header .responsive {
        width: calc(100% - 1.25rem);
    }

    .header-logo {
        font-size: 0.78rem;
        letter-spacing: 0.015em;
    }

    .header-logo img {
        width: 36px;
        height: 36px;
    }

    main.responsive {
        width: calc(100% - 1.25rem);
    }

    .auth-container {
        margin-top: 2.5rem;
    }

    .box,
    .card-body {
        padding: 0.85rem;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    thead th,
    tbody td {
        white-space: nowrap;
    }
}
