@import "colors.css";

* { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background-color: rgba(29, 53, 87, 1);
    background-image: linear-gradient(90deg, rgba(29, 53, 87, 1) 10%, rgba(69, 123, 157, 1) 50%, rgba(29, 53, 87, 1) 90%);
    font-size: 12px;
    margin: 0 auto;
    padding: 0;
    color: var(--honeydew);
}

a { color: var(--non-photo-blue); text-decoration: none; }
a:hover, a:active { color: var(--red-pantone); text-decoration: underline; }

.container {
    width: 960px;
    max-width: calc(100% - 10px);
    margin: 5px auto;
    background: var(--berkeley-blue);
}

header {
    height: 100px;
    background-color: var(--cerulean);
    background-image: linear-gradient(90deg, #457b9d 0%, #1d3557 65%, #003366 100%);
    position: relative;
    overflow: hidden;
}

.header-bg { height: 100px; display: flex; flex-direction: column; justify-content: center; padding: 0 22px; }
.brand-link { color: white !important; text-decoration: none !important; }
.brand-title { font-size: 34px; font-weight: bold; letter-spacing: 1px; color: white; }
.brand-subtitle { margin-top: 5px; font-size: 13px; color: var(--non-photo-blue); }

main { padding: 10px 5px; }

footer {
    background: #003366;
    color: var(--honeydew);
    text-align: center;
    padding: 1px;
    width: 100%;
}
.footer-time { font-size: 10px; }
.back-top { text-align: right; font-size: 10px; max-width: 960px; margin: 0 auto; }

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #003366;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}
.top-bar-left { flex-grow: 1; }
.top-bar-right { text-align: right; white-space: nowrap; }
.top-bar a { color: var(--non-photo-blue); margin-left: 6px; }

.reg-search { display: inline-block; margin-right: 6px; }
.reg-search input[type="text"] {
    padding: 4px;
    font-size: 12px;
    width: 145px;
    border-radius: 3px;
    border: 1px solid #ccc;
}
.reg-search button {
    background: #555;
    color: white;
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
}
.reg-search button:hover { background: #333; }

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #003366;
    display: flex;
}
.main-nav li { position: relative; }
.main-nav li a { color: white; display: block; padding: 5px 11px 4px; text-decoration: none; }
.main-nav li a:hover { background: var(--jasnoniebieski); }
.main-nav li ul {
    display: none;
    position: absolute;
    left: 0;
    min-width: 200px;
    margin: 0;
    padding: 0;
    background: #003366;
    z-index: 1000;
}
.main-nav li:hover > ul, .main-nav li.open > ul { display: block; }
.main-nav li ul li { width: 200px; }
.main-nav li ul li a { padding: 8px 10px; white-space: nowrap; }

.section-header, .page-title1, .page-title2 {
    background: var(--jasnoniebieski);
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}
.section-header { padding: 6px 8px; font-size: 14px; }
.page-title1 { padding: 10px; font-size: 20px; margin-bottom: 10px; }
.page-title2 { padding: 8px 10px; font-size: 16px; margin: 12px 0 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 5px;
}
.dashboard-card {
    background: var(--cerulean);
    padding: 14px;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0 0 4px 4px;
}
.dashboard-card span { font-size: 12px; }
.dashboard-card strong { font-size: 25px; color: white; }
.dashboard-card .small-value { font-size: 15px; }

.table-wrap { width: 100%; overflow-x: auto; }
.styled-table { width: 100%; border-collapse: collapse; margin: 5px 0 20px; background: var(--berkeley-blue); }
.styled-table th, .styled-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--cerulean); vertical-align: top; }
.styled-table thead tr { background: var(--cerulean); }
.styled-table tbody tr:hover { background: #28476f; }
.compact-table { font-size: 11px; }
.message-text { max-width: 390px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Consolas, monospace; }

.info-table { width: 100%; border-collapse: collapse; border: 1px solid var(--cerulean); }
.info-table th { width: 190px; text-align: right; background: var(--jasnoniebieski); padding: 6px; }
.info-table td { background: var(--berkeley-blue); padding: 6px; border-bottom: 1px solid var(--cerulean); }

.raw-message {
    margin: 0;
    padding: 12px;
    background: #07182c;
    color: #d8f3ff;
    border: 1px solid var(--cerulean);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}
.placeholder-box { padding: 12px; border: 1px solid var(--cerulean); background: #28476f; }

.alert { max-width: 700px; margin: 10px auto; padding: 10px; border-radius: 4px; font-weight: bold; text-align: center; }
.alert.error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.alert.success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }

.auth-box { max-width: 500px; margin: 20px auto; background: #28476f; border-radius: 4px; overflow: hidden; }
.auth-box.wide { max-width: 650px; }
.auth-form { padding: 15px; }
.auth-form label { display: block; margin-bottom: 12px; font-weight: bold; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 8px;
    border: 1px solid var(--cerulean);
    border-radius: 3px;
}
.check-label { font-weight: normal !important; }

.filter-box { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 10px; padding: 8px; background: #28476f; }
.filter-box label { font-weight: bold; }
.filter-box input { display: block; margin-top: 4px; padding: 5px; }

.btn-edit, .btn-small {
    display: inline-block;
    background: var(--jasnoniebieski);
    color: white !important;
    border: 0;
    border-radius: 4px;
    text-decoration: none !important;
    cursor: pointer;
}
.btn-edit { padding: 8px 15px; }
.btn-small { padding: 5px 7px; font-size: 11px; }
.btn-edit:hover, .btn-small:hover { background: var(--cerulean); }
.btn-edit.secondary { background: #555; }
.inline-form { display: inline; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; }
.uppercase { text-transform: uppercase; }

@media (max-width: 800px) {
    .top-bar { align-items: flex-start; flex-direction: column; }
    .top-bar-right { text-align: left; white-space: normal; }
    .main-nav ul { flex-wrap: wrap; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .brand-title { font-size: 28px; }
}

/* ==========================================================
   ZicherACARS dashboard / archiwum
   ========================================================== */
.dashboard-grid-6 {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-link {
    color: inherit !important;
    text-decoration: none !important;
    transition: transform .15s ease, background-color .15s ease;
}
.dashboard-link:hover {
    transform: translateY(-2px);
    background: #4f8bad;
}
.dashboard-link:hover strong { color: white; }

.section-header-flex,
.page-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.section-header-note {
    font-size: 10px;
    font-weight: normal;
    opacity: .9;
}
.page-title-count {
    font-size: 12px;
    font-weight: normal;
}

.dashboard-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.no-bottom-margin { margin-bottom: 0; }
.section-more { text-align: right; margin: -10px 3px 12px 0; }

.protocol-badge {
    display: inline-block;
    min-width: 45px;
    padding: 2px 5px;
    border-radius: 3px;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
}
.protocol-badge.large { font-size: 12px; padding: 4px 8px; }
.protocol-acars { background: #457b9d; }
.protocol-vdl2 { background: #0077cc; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    align-items: end;
}
.filter-grid label { min-width: 0; }
.filter-grid input,
.filter-grid select {
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    padding: 5px;
    border: 1px solid #457b9d;
    border-radius: 3px;
}
.filter-text-wide { grid-column: span 2; }
.filter-actions { display: flex; align-items: center; gap: 6px; }
.check-filter { display: flex; align-items: center; gap: 5px; font-weight: normal !important; }
.check-filter input { width: auto; }

.pagination-full > div {
    min-width: 180px;
}
.pagination-full > div:last-child { text-align: right; }

.message-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 8px;
}
.message-nav > div:last-child { text-align: right; }

.message-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.message-details-grid .info-table th { width: 145px; }

code {
    font-family: Consolas, "Courier New", monospace;
    color: #d8f3ff;
}

@media (max-width: 800px) {
    .dashboard-grid-6 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-two-columns,
    .message-details-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-text-wide { grid-column: span 2; }
}

@media (max-width: 520px) {
    .dashboard-grid-6,
    .filter-grid { grid-template-columns: 1fr; }
    .filter-text-wide { grid-column: span 1; }
    .section-header-flex,
    .page-title-flex { align-items: flex-start; flex-direction: column; }
    .message-nav { grid-template-columns: 1fr; gap: 6px; text-align: center; }
    .message-nav > div:last-child { text-align: center; }
    .pagination-full > div { min-width: 0; }
}
