/* Faq-O-Matic Modern Theme — APPX Brand Edition
   Matches www.appx.com color palette and typography
   2026-03-23 */

/* ===== Reset & Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

body {
    font-family: 'Trebuchet MS', 'Helvetica Neue', Arial, Helvetica, sans-serif !important;
    line-height: 1.65;
    color: #555 !important;
    background-color: #eaf6fb !important;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ===== Page Wrapper ===== */
.fom-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.fom-header {
    background: linear-gradient(135deg, #063a47 0%, #085360 40%, #00798e 100%);
    color: #fff;
    padding: 0;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(8,83,96,0.3);
    position: relative;
    overflow: hidden;
}

/* Subtle animated shimmer on header */
.fom-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(110deg,
        transparent 20%,
        rgba(255,255,255,0.03) 40%,
        rgba(255,255,255,0.06) 50%,
        rgba(255,255,255,0.03) 60%,
        transparent 80%);
    background-size: 200% 100%;
    animation: shimmer 8s ease-in-out infinite;
    pointer-events: none;
}

.fom-header .fom-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 18px;
    padding-bottom: 18px;
    position: relative;
    z-index: 1;
}

.fom-header a {
    border-bottom: none !important;
}

.fom-header a:hover {
    border-bottom: none !important;
}

.fom-logo-link {
    flex-shrink: 0;
}

.fom-header img {
    height: 48px;
    width: auto;
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.fom-header img:hover {
    transform: scale(1.05);
}

/* Header right section: tagline, search, back link */
.fom-header-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fom-header .fom-tagline {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    text-transform: uppercase;
    margin-right: auto;
}

/* Header search bar */
.fom-search {
    display: flex;
    align-items: center;
    gap: 0;
}

.fom-search input[type="text"] {
    padding: 8px 14px !important;
    border: 2px solid rgba(255,255,255,0.25) !important;
    border-right: none !important;
    border-radius: 8px 0 0 8px !important;
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
    font-size: 0.85rem;
    width: 200px;
    transition: background 0.25s ease, border-color 0.25s ease, width 0.3s ease;
    backdrop-filter: blur(4px);
}

.fom-search input[type="text"]::placeholder {
    color: rgba(255,255,255,0.55);
}

.fom-search input[type="text"]:focus {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.5) !important;
    width: 260px;
    box-shadow: none !important;
    transform: none !important;
}

.fom-search button {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.25);
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fom-search button:hover {
    background: rgba(255,255,255,0.3);
}

/* Back to appx.com link */
.fom-back-link {
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease !important;
}

.fom-back-link:hover {
    color: #fff !important;
}

/* ===== Main Content Cards ===== */
body > table[width="100%"],
.fom-wrapper > table[width="100%"] {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease both;
    transition: box-shadow 0.3s ease;
}

body > table[width="100%"]:hover,
.fom-wrapper > table[width="100%"]:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.08);
}

/* ===== Table Cells ===== */
body > table td,
.fom-wrapper > table td {
    padding: 18px 24px !important;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    transition: background-color 0.2s ease;
}

body > table tr:last-child td,
.fom-wrapper > table tr:last-child td {
    border-bottom: none;
}

/* ===== Left Accent Bar ===== */
td[bgcolor="#106D84"],
td[bgcolor="#106d84"],
td[bgcolor=#106D84] {
    background: linear-gradient(180deg, #085360 0%, #00798e 50%, #07a2ad 100%) !important;
    width: 6px !important;
    min-width: 6px !important;
    max-width: 6px !important;
    padding: 0 !important;
    border-radius: 12px 0 0 12px;
    border-bottom: none !important;
}

td[bgcolor="#106D84"] img,
td[bgcolor="#106d84"] img,
td[bgcolor=#106D84] img {
    display: none;
}

/* ===== Content Area Colors ===== */
td[bgcolor="#e0e0e0"],
td[bgcolor=#e0e0e0] {
    background-color: #f8fafb !important;
}

td[bgcolor="#ffffd0"],
td[bgcolor=#ffffd0] {
    background-color: #edf6f9 !important;
}

/* ===== Titles ===== */
font[size="+1"] {
    font-size: 1.6rem !important;
}

font[size="+1"] b {
    font-weight: 700;
    color: #085360;
    letter-spacing: -0.01em;
}

/* ===== Links ===== */
a {
    color: #00798e !important;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: #085360 !important;
    text-decoration: none;
    border-bottom: 1px solid #085360;
}

a:visited {
    color: #5a7a85 !important;
}

/* ===== Category & Answer Links ===== */
a img[alt*="Category"],
a img[alt*="Answer"] {
    vertical-align: middle;
    margin-right: 8px;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover img[alt*="Category"],
a:hover img[alt*="Answer"] {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Category/answer link rows — hover highlight */
td[bgcolor="#ffffd0"] a,
td[bgcolor=#ffffd0] a {
    display: inline-block;
    padding: 4px 8px;
    margin: 1px 0;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.15s ease;
    border-bottom: none !important;
}

td[bgcolor="#ffffd0"] a:hover,
td[bgcolor=#ffffd0] a:hover {
    background-color: rgba(0,121,142,0.08);
    transform: translateX(4px);
    border-bottom: none !important;
}

/* ===== Edit Links ===== */
font[size="-1"] {
    font-size: 0.8rem !important;
    color: #8899aa;
}

font[size="-1"] a {
    color: #8899aa !important;
    font-weight: 500;
    border-bottom: none !important;
    transition: color 0.2s ease;
}

font[size="-1"] a:hover {
    color: #00798e !important;
    border-bottom: 1px dashed #00798e !important;
}

/* ===== Timestamps ===== */
td > i {
    color: #99aabb;
    font-style: normal;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ===== Override <font> tags ===== */
font { font-family: inherit !important; }
font[face] { font-family: inherit !important; }
font[color="#106D84"] { color: inherit !important; }

/* ===== Hide line breaks ===== */
body > br,
.fom-wrapper > br {
    display: none;
}

/* ===== Sibling Navigation ===== */
table:not([width]):not([bgcolor]) {
    margin: 16px 0;
    animation: fadeIn 0.4s ease 0.3s both;
}

table:not([width]):not([bgcolor]) td {
    padding: 6px 10px;
    font-size: 0.9rem;
    color: #5a7a85;
}

table:not([width]):not([bgcolor]) a {
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

table:not([width]):not([bgcolor]) a:hover {
    background-color: rgba(0,121,142,0.08);
    border-bottom: none !important;
}

/* ===== Footer Navigation ===== */
table[bgcolor="#e0e0e0"],
table[width="100%"][bgcolor="#e0e0e0"] {
    background: #fff !important;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin: 32px 0 16px 0;
    overflow: hidden;
    animation: fadeIn 0.5s ease 0.4s both;
}

table[bgcolor="#e0e0e0"] table {
    box-shadow: none !important;
    margin: 0 !important;
}

table[bgcolor="#e0e0e0"] td {
    padding: 14px 18px !important;
    text-align: center;
    border-bottom: none !important;
}

/* Nav link buttons */
table[bgcolor="#e0e0e0"] td a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    border-bottom: none !important;
}

table[bgcolor="#e0e0e0"] td a:hover {
    background-color: #edf6f9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,121,142,0.15);
    border-bottom: none !important;
}

table[bgcolor="#e0e0e0"] tr:last-child td {
    font-size: 0.78rem;
    color: #99aabb;
    padding-top: 6px !important;
    padding-bottom: 16px !important;
}

table[bgcolor="#e0e0e0"] tr:last-child td a {
    font-weight: 400;
    padding: 4px 8px;
}

/* ===== Forms ===== */
input[type="text"],
input[type="password"],
textarea {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    border: 2px solid #e3e3e3;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    outline: none;
    width: auto;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: #00798e;
    box-shadow: 0 0 0 4px rgba(0,121,142,0.1);
    transform: translateY(-1px);
}

input[type="submit"],
input[type="button"] {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 24px;
    background: linear-gradient(135deg, #085360 0%, #00798e 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease;
    box-shadow: 0 2px 6px rgba(8,83,96,0.25);
}

input[type="submit"]:hover,
input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8,83,96,0.35);
    filter: brightness(1.1);
}

input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(8,83,96,0.2);
}

select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    border: 2px solid #e3e3e3;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.25s ease;
}

select:focus {
    border-color: #00798e;
    outline: none;
}

/* ===== Hide visual noise ===== */

/* "This document is:" permalink */
.fom-docurl {
    font-size: 0.78rem;
    color: #99aabb;
    margin: 12px 0 4px 0;
}

.fom-docurl a {
    color: #99aabb !important;
    font-size: 0.78rem;
    border-bottom: none !important;
}

.fom-docurl a:hover {
    color: #00798e !important;
}

/* Hide old timestamps — they make the site look abandoned */
td > i:only-child {
    display: none;
}

/* Hide the row containing only a timestamp */
tr:last-child td:only-child i:only-child {
    display: none;
}

/* Make "Faq-O-Matic 2.719" attribution very subtle */
table[bgcolor="#e0e0e0"] tr:last-child td {
    font-size: 0;
    padding: 0 !important;
    line-height: 0;
    height: 0;
    overflow: hidden;
}

/* Strip brackets from nav links [Search] -> Search */
table[bgcolor="#e0e0e0"] td {
    font-size: 0;
}

table[bgcolor="#e0e0e0"] td a {
    font-size: 0.85rem;
}

/* ===== Copyright Footer ===== */
body > :last-child {
    text-align: center;
    font-size: 0.78rem;
    color: #99aabb;
    padding: 8px 0 32px 0;
}

/* ===== Search Result Highlights ===== */
font[color="#ff0000"] b,
font[color="#a01010"] b {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    color: #856404 !important;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ===== Content Readability ===== */
td[bgcolor="#e0e0e0"] p,
td[bgcolor=#e0e0e0] p {
    margin: 0.6em 0;
}

td[bgcolor="#e0e0e0"],
td[bgcolor=#e0e0e0] {
    line-height: 1.7;
}

/* ===== Staggered fade-in for table rows ===== */
body > table tr,
.fom-wrapper > table tr {
    animation: fadeIn 0.4s ease both;
}

body > table tr:nth-child(1), .fom-wrapper > table tr:nth-child(1) { animation-delay: 0.05s; }
body > table tr:nth-child(2), .fom-wrapper > table tr:nth-child(2) { animation-delay: 0.1s; }
body > table tr:nth-child(3), .fom-wrapper > table tr:nth-child(3) { animation-delay: 0.15s; }
body > table tr:nth-child(4), .fom-wrapper > table tr:nth-child(4) { animation-delay: 0.2s; }
body > table tr:nth-child(5), .fom-wrapper > table tr:nth-child(5) { animation-delay: 0.25s; }
body > table tr:nth-child(6), .fom-wrapper > table tr:nth-child(6) { animation-delay: 0.3s; }
body > table tr:nth-child(7), .fom-wrapper > table tr:nth-child(7) { animation-delay: 0.35s; }
body > table tr:nth-child(8), .fom-wrapper > table tr:nth-child(8) { animation-delay: 0.4s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .fom-header .fom-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .fom-header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fom-search {
        width: 100%;
    }

    .fom-search input[type="text"] {
        flex: 1;
        width: 100% !important;
    }

    .fom-search input[type="text"]:focus {
        width: 100% !important;
    }

    .fom-back-link {
        align-self: flex-start;
    }

    body > table td,
    .fom-wrapper > table td {
        padding: 14px 16px !important;
    }

    font[size="+1"] {
        font-size: 1.3rem !important;
    }

    table[bgcolor="#e0e0e0"] td {
        display: block;
        text-align: left;
        padding: 8px 14px !important;
    }
}

@media (max-width: 480px) {
    td[bgcolor="#106D84"],
    td[bgcolor="#106d84"],
    td[bgcolor=#106D84] {
        display: none;
    }

    body > table[width="100%"],
    .fom-wrapper > table[width="100%"] {
        border-radius: 8px;
    }

    .fom-header {
        margin-bottom: 20px;
    }
}

/* ===== Back to Top Button ===== */
.fom-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #085360, #00798e);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(8,83,96,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    z-index: 999;
}

.fom-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fom-top-btn:hover {
    box-shadow: 0 6px 20px rgba(8,83,96,0.45);
    transform: translateY(-3px);
}

.fom-top-btn:active {
    transform: translateY(0) scale(0.95);
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f1923 !important;
        color: #c8d6df !important;
    }

    body > table[width="100%"],
    .fom-wrapper > table[width="100%"] {
        background: #162431;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    body > table[width="100%"]:hover,
    .fom-wrapper > table[width="100%"]:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }

    body > table td,
    .fom-wrapper > table td {
        border-bottom-color: #1e3040;
    }

    td[bgcolor="#e0e0e0"],
    td[bgcolor=#e0e0e0] {
        background-color: #1a2d3d !important;
    }

    td[bgcolor="#ffffd0"],
    td[bgcolor=#ffffd0] {
        background-color: #152535 !important;
    }

    font[size="+1"] b {
        color: #7ec8d8;
    }

    a {
        color: #4db8c9 !important;
    }

    a:hover {
        color: #7ed4e4 !important;
    }

    a:visited {
        color: #6a9aaa !important;
    }

    td[bgcolor="#ffffd0"] a:hover,
    td[bgcolor=#ffffd0] a:hover {
        background-color: rgba(77,184,201,0.1);
    }

    font[size="-1"],
    font[size="-1"] a {
        color: #5a7a8a !important;
    }

    font[size="-1"] a:hover {
        color: #4db8c9 !important;
    }

    td > i {
        color: #4a6a7a;
    }

    .fom-docurl,
    .fom-docurl a {
        color: #4a6a7a !important;
    }

    .fom-docurl a:hover {
        color: #4db8c9 !important;
    }

    table[bgcolor="#e0e0e0"],
    table[width="100%"][bgcolor="#e0e0e0"] {
        background: #162431 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }

    table[bgcolor="#e0e0e0"] td a:hover {
        background-color: rgba(77,184,201,0.1);
    }

    table:not([width]):not([bgcolor]) td {
        color: #6a8a9a;
    }

    table:not([width]):not([bgcolor]) a:hover {
        background-color: rgba(77,184,201,0.1);
    }

    input[type="text"],
    input[type="password"],
    textarea,
    select {
        background: #1a2d3d;
        border-color: #2a4050;
        color: #c8d6df;
    }

    input[type="text"]:focus,
    input[type="password"]:focus,
    textarea:focus {
        border-color: #4db8c9;
        box-shadow: 0 0 0 4px rgba(77,184,201,0.15);
    }

    .fom-top-btn {
        background: linear-gradient(135deg, #1a3a4a, #2a5a6a);
    }

    font[color="#ff0000"] b,
    font[color="#a01010"] b {
        background: #2a3a20;
        color: #c8d870 !important;
    }
}

/* ===== Print ===== */
@media print {
    .fom-header { background: none; color: #000; box-shadow: none; }
    .fom-header::after { display: none; }
    body { background: #fff !important; }
    body > table[width="100%"],
    .fom-wrapper > table[width="100%"] { box-shadow: none; }
    a { color: #000 !important; }
    table[bgcolor="#e0e0e0"] { display: none; }
}
