/* =====================================================
   ADIF Merge Studio
   Hauptstylesheet 
   Grundlayout + Kopf + Dateien
   ===================================================== */

/* =====================================================
   Grundlayout
   ===================================================== */

* {
    box-sizing:border-box;
}

body {
    margin:0;
    padding:20px;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background:#f4f6f8;
    color:#222;
}

#adifMerge {
    max-width:1400px;
    margin:auto;
}


/* =====================================================
   Kopfbereich
   ===================================================== */

.am-header {
    background:white;
    padding:15px 20px;
    border-radius:12px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.08);
    margin-bottom:15px;
}


.am-header h1 {
    margin:0 0 8px 0;
    font-size:36px;
    color:#2f5ea8;
}


.am-header p {
    margin:0;
    color:#555;
    font-size:15px;
    line-height:1.35;
}


.am-header b {
    color:#1976d2;
}

/* =====================================================
   Hilfe
   ===================================================== */

.am-help {
    margin-top:25px;
    margin-bottom:25px;
    background:white;
    border-radius:12px;
    overflow:hidden;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.08);
}


/* Äußerer Hilfe-Kopf */

.am-help-header {
    display:block;
    padding:10px 15px;
    background:#f3f3f3;
    color:#333;
    font-size:18px;
    font-weight:bold;
    cursor:pointer;
    user-select:none;
    border-bottom:1px solid #ddd;
}


/* Pfeil des details-Elements */

.am-help-header::marker {
    color:white;
}


/* Hilfe-Inhalt */

.help-content {
    padding:20px;
}

/* Innere Hilfe-Bereiche */

.help-content details {
    margin-top:12px;
    border:1px solid #ddd;
    border-radius:8px;
    padding:10px;
}

.help-content summary {
    cursor:pointer;
    font-size:17px;
    font-weight:bold;
}

.help-content p {
    line-height:1.5;
}

.help-content li {
    margin-bottom:5px;
}

.help-content code {
    display:inline-block;
    background:#eee;
    padding:5px 10px;
    border-radius:5px;
}

/* =====================================================
   Dateiauswahl
   ===================================================== */

/* =====================================================
   Dateiauswahl
   ===================================================== */

.am-files {
    display:flex;
    gap:15px;
    align-items:stretch;
}

.am-panel {
    flex:1;
    background:white;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

.am-title {
    background:#2f5ea8;
    color:white;
    padding:9px 15px;
    font-size:17px;
    font-weight:bold;
}

.am-drop {
    min-height:70px;
    padding:8px 10px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    border:2px dashed #bbb;
    margin:8px 10px 10px 10px;
    border-radius:8px;
}

.am-drop:hover {
    background:#eef5ff;
    border-color:#2f5ea8;
}

.am-icon {
    font-size:25px;
    margin-bottom:3px;
}

.am-text {
    font-size:14px;
}

.am-small {
    font-size:12px;
    margin:3px 0;
}


/* Datei laden Button */

.am-button {
    display:inline-block;
    background:#1976d2;
    color:white;
    padding:8px 18px;
    border-radius:6px;
    font-weight:bold;
    cursor:pointer;
    border:0;
    transition:
        background .2s,
        transform .1s;
}

.am-button:hover {
    background:#125aa0;
}

.am-button:active {
    transform:scale(.97);
}


/* Dateiinformation */

.am-info {
    width:calc(100% - 24px);
    margin:12px;
    border-collapse:collapse;
}

.am-info td {
    padding:4px 6px;
    border-bottom:1px solid #ddd;
}

.am-info td:first-child {
    font-weight:bold;
    width:100px;
}

.am-info tr:last-child td {
    border-bottom:none;
}


/* Pfeil zwischen Dateien */

.am-center {
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:40px;
    color:#2f5ea8;
    min-width:50px;
}


/* Datumsbereich + Zeit */

.am-top-row{
    display:flex;
    align-items:flex-start;
    gap:40px;
    margin-bottom:15px;      /* kleiner Abstand zum Bandfilter */
}

.am-dategroup{
    text-align:left;
}

.am-timegroup{
    width:170px;
    text-align:left;
}

.group-title{
    font-size:18px;
    font-weight:bold;
    margin-bottom:8px;
}

.date-fields{
    display:flex;
    gap:12px;
}

.date-field{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
}

.date-field label{
    font-size:15px;
    margin-bottom:5px;
}

.date-field input[type="date"]{
    width:150px;
    padding:6px 4px;
    font-size:16px;
}

.date-field select{
    width:150px;
    padding:6px 4px;
    font-size:16px;
    height:36px;
}


/* =====================================================
   Toolbar
   ===================================================== */

.am-toolbar {
    margin:20px 0;
    text-align:center;
}

.am-start {
    padding:10px 30px;
    font-size:18px;
    border:0;
    border-radius:8px;
    background:#16803c;
    color:white;
    cursor:pointer;
}

.am-start:hover {
    background:#10622e;
}


/* =====================================================
   Status und Fortschritt
   ===================================================== */

.am-status {
    background:white;
    padding:15px;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

#statusText {
    margin-top:8px;
    color:#555;
}

/* allgemeiner Ladebalken */

.am-progress {
    height:12px;
    width:100%;
    background:#ddd;
    border-radius:10px;
    overflow:hidden;
}

.am-progress-bar {
    height:100%;
    width:0;
    background:#2f5ea8;
    transition:.3s;
}

/* Datei-Ladefortschritt */

.load-progress {
    width:100%;
    height:8px;
    background:#ddd;
    border-radius:5px;
    overflow:hidden;
    margin-top:10px;
}

.load-progress-bar {
    height:100%;
    width:0%;
    background:#1976d2;
    transition:width .2s;
}

.load-text {
    font-size:12px;
    text-align:center;
    margin-top:4px;
    color:#555;
}


/* =====================================================
   Gemeinsame Bereichsboxen
   Export + Vergleich
   ===================================================== */

.am-export,
.am-result {

    margin-top:25px;
    background:white;
    border-radius:12px;
    overflow:hidden;

    box-shadow:
        0 2px 8px rgba(0,0,0,0.08);

}

.am-result-header {
    padding:10px 15px;
    background:#2f5ea8;
    color:white;
    font-size:18px;
    font-weight:bold;
}

/* =====================================================
   Export gefiltertes Ergebnis
   ===================================================== */

.export-options {
    display:flex;
    align-items:flex-end;
    gap:20px;
    padding:20px;

}

.export-field {
    display:flex;
    flex-direction:column;
}

.export-field label {
    font-size:15px;
    margin-bottom:5px;
}

.export-field select {
    padding:6px 10px;
    font-size:16px;
}

/* =====================================================
   Statistik
   ===================================================== */

.am-stat-container{
    display:flex;
    gap:30px;
    padding:15px;
}

.am-stats h3{
    margin-top:0;
    font-size:16px;
}

.am-summary {
    display:flex;
    gap:30px;
    padding:15px;
    background:#fafafa;
    border-bottom:1px solid #ddd;
}

.am-stats {
    min-width:230px;
}

.am-stats div {
    margin-bottom:6px;
}


/* =====================================================
   Vergleichstabelle
   Struktur:

   Log A | Pfeil | Status | Log B

   ===================================================== */
.qso-number{
    text-align:center;
    font-weight:bold;
    color:#666;
    background:#f7f7f7;
    font: size 14px;
}

.am-compare {
    padding:20px;
    overflow-x:auto;
}

.am-table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:14px;
}

/* Tabellenkopf */

.am-table thead tr:first-child th{
    background:#333;
    color:white;
    padding:10px;
    position:sticky;
    top:0;
    z-index:3;
}

.am-table thead tr:nth-child(2) th{
    background:#333;
    color:white;
    padding:10px;
    position:sticky;
    top:56px;
    z-index:2;
}

.am-table th:nth-child(1),
.am-table th:nth-child(2),
.am-table th:nth-child(8),
.am-table th:nth-child(9) {
    text-align:center;
}

.am-table td {
    padding: 2px;
    border-bottom:1px solid #eee;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* =====================================================
   Spaltenbreiten

   ===================================================== */

/* Trennung vor und nach Mittelblock */

/* Trennlinie vor Mittelspalte */
.am-table th:nth-child(8),
.am-table td:nth-child(8) {
    border-left:3px solid #888;
    border-right:3px solid #888;
}

/* keine Linie vor Status B */
.am-table th:nth-child(9),
.am-table td:nth-child(9) {
    border-left:none;
}


/* =====================================================
   Logdaten Hover
   ===================================================== */

.am-table tbody tr:hover td {
    background:#eef5ff;
}

/* =====================================================
   Statusfarben
   NUR Logdaten!
   Mittelblock bleibt grau
   ===================================================== */

#compareBody .statusIdentical td:not(:nth-child(1)):not(:nth-child(8)) {
    background:#b7e4b7;
}

#compareBody .statusMatch td:not(:nth-child(1)):not(:nth-child(8)) {
    background:#fff2a8;
}

#compareBody .statusDifference td:not(:nth-child(1)):not(:nth-child(8)) {
    background:#ffcccc;
}

#compareBody .statusOnlyA td:not(:nth-child(1)):not(:nth-child(8)) {
    background:#b9d8ff;
}

#compareBody .statusOnlyB td:not(:nth-child(1)):not(:nth-child(8)) {
    background:#d8b9ff;
}

/* =====================================================
   Vergleich Filter
   ===================================================== */

.am-filter {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    padding:15px;
    background:#fafafa;
    border-bottom:1px solid #ddd;
}

.filter-title {
    font-weight:bold;
}

.am-filter-buttons {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.filter-button {
    border:1px solid #999;
    padding:7px 14px;
    border-radius:20px;
    cursor:pointer;
    font-weight:bold;
    background:white;
}

.filter-button:hover {
    opacity:.8;
}

.filter-button.active {
    outline:3px solid #333;
}


/* Filterfarben */

.filter-all {
    background:#eeeeee;
}

.filter-identical {
    background:#b7e4b7;
}

.filter-match {
    background:#fff2a8;
}

.filter-difference {
    background:#ffcccc;
}

.filter-onlyA {
    background:#b9d8ff;
}

.filter-onlyB {
    background:#d8b9ff;
}


/* =====================================================
   Detailbereich
   ===================================================== */

.am-detail {
    border-top:1px solid #ddd;
    padding:20px;
}

.am-detail h2 {
    margin:0;
    padding:10px 15px;
    background:#2f5ea8;
    color:white;
    font-size:18px;
    font-weight:bold;
    border-radius:12px 12px 0 0;
}

.am-detail h3 {
    margin-top:0;
}


/* =====================================================
   Unterschiedstabelle
   ===================================================== */

.difference-table {
    border-collapse:collapse;
    margin-top:15px;
    width:auto;
}

.difference-table th {
    background:#333;
    color:white;
    padding:8px;
    text-align:left;
}

.difference-table td {
    padding:6px 8px;
    border-bottom:1px solid #ddd;
    vertical-align:top;
}

/* Feldname */

.difference-table td:first-child {
    width:140px;
    font-weight:bold;
    background:#f5f5f5;
}

/* identisch */

.diff-identical td {
    background:#dff5df;
}

/* unwichtige Unterschiede */

.diff-minor td {
    background:#eeeeee;
}

/* normale Unterschiede */

.diff-normal td {
    background:#fff6bf;
}

/* kritische Unterschiede */

.diff-critical td {
    background:#ffd6d6;
}

/* Werte hervorheben */

.diff-critical td:nth-child(2),
.diff-critical td:nth-child(3),
.diff-normal td:nth-child(2),
.diff-normal td:nth-child(3) {
    font-weight:bold;
}


/* =====================================================
   Mobile Darstellung
   ===================================================== */

@media(max-width:900px){

    body {
        padding:10px;
    }

    .am-files {
        flex-direction:column;
    }

    .am-summary {
        flex-direction:column;
        gap:20px;
    }

    .am-compare {
        overflow-x:auto;
        padding:10px;
    }

    .am-table {
        min-width:950px;
    }
}

/* =====================================================
   Tabellenausrichtung
   ===================================================== */

/* Überschriften */
.am-table th {
    text-align:left;
}

/* Tabelleninhalt */
.am-table td {
    text-align:left;
}

.am-table th:nth-child(1),
.am-table td:nth-child(1),

.am-table th:nth-child(2),
.am-table td:nth-child(2),

.am-table th:nth-child(8),
.am-table td:nth-child(8),

.am-table th:nth-child(9),
.am-table td:nth-child(9){
    text-align:center;
}

/* Gruppenüberschriften */
.am-table .group-head {
    text-align:center;
}


/* Pfeil */
.am-table .action-head {
    text-align:center;
}

/* =====================================================
   Scrollbereiche
   ===================================================== */

.am-table-container {
    overflow-y:auto;
    overflow-x:auto;
    height:calc(var(--visible-rows,10) * 33px + 95px);
    margin-bottom:2px;
}


/* =====================================================
   Tabellen allgemein
   ===================================================== */

.am-table tbody tr:hover {
    cursor:pointer;
}


/* =====================================================
   Statussymbol sauber darstellen
   ===================================================== */

/* Statussymbol */

.qso-status {
    font-size:16px;
    font-weight:bold;
    text-align:center;
}

/* Pfeil */

.merge-action {
    font-size:24px;
    font-weight:bold;
    text-align:center;
}

/* =====================================================
   Kopfzeile Trennlinien
   ===================================================== */

.am-table thead tr:first-child th:first-child {
    border-right:none;
}

.am-table thead tr:first-child th:first-child + th {
    border-right:3px solid #888;
}


/* =====================================================
   Keine Farbdurchbrüche Mittelspalte
   ===================================================== */

.am-table .merge-action,
.am-table .qso-status {
    background:#e8e8e8 !important;
}

/* Erste Kopfzeile */

.am-table thead tr:first-child th:nth-child(2) {
    border-right:3px solid #888;
}

.am-table thead tr:first-child th:last-child {
    border-left:3px solid #888;
}

/* File Center Button */

.am-center button {

    width:70px;
    height:70px;

    border:0;
    border-radius:50%;

    background:#1976d2;
    color:white;

    font-size:42px;
    font-weight:bold;

    cursor:pointer;

    box-shadow:
        0 3px 8px rgba(0,0,0,0.25);

    transition:
        background .2s,
        transform .15s;
}

.am-center button:hover {
    background:#0d47a1;
    transform:scale(1.12);
}

.am-center button:active {
    transform:scale(.95);
}

/* =====================================================
   Ende ADIF Merge Studio CSS
   ===================================================== */