/* Grundläggande styling */
body {
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #1a1a1a;
    border-bottom: 2px solid #333;
}

header h1 {
    font-size: 24px;
    margin: 0;
}

header button {
    background: rgba(0, 255, 204, 0.1);
    color: #00ffcc;
    border: 1px solid #00ffcc;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

header button:hover {
    background: #00ffcc;
    color: black;
}

/* Knappar */
button {
    background: rgba(0, 255, 204, 0.1);
    color: #00ffcc;
    border: 1px solid #00ffcc;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

button:hover {
    background: #00ffcc;
    color: black;
}

/* Container för traktor och kartor */
.device-container {
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid #00ffcc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Grid-layout för traktordata */
.device-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

/* Mobil-anpassning: tabellen ovanför kartan */
@media (max-width: 768px) {
    .device-grid {
        flex-direction: column;
    }
}

.command-response {
    margin-top: 10px;
    font-weight: bold;
    font-size: 14px;
}


/* Kartan */
.map-container {
    flex: 1 1 100%;
    min-height: 400px;
    height: 400px;
    width: 100%;
    border-radius: 10px;
    position: relative;
}


.tractor-icon {
    text-align: center;
    line-height: 1;
}

/* Kontrollpanel */
.control-panel {
    background: rgba(43, 43, 43, 0.8);
    color: #ffffff;
    border: 1px solid #00ffcc;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tabeller */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 255, 204, 0.05);
}

table th, table td {
    border: 1px solid #00ffcc;
    padding: 10px;
    text-align: left;
}

table th {
    background: rgba(0, 255, 204, 0.1);
    color: #00ffcc;
}

table td {
    color: white;
}

/* Flikar */
.tab-button {
    background-color: rgba(0, 255, 204, 0.1);
    border: 1px solid #00ffcc;
    color: #00ffcc;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.tab-button:hover, .tab-button.active {
    background-color: #00ffcc;
    color: black;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Mobilanpassad popup för fältval */
@media (max-width: 768px) {
    .responsive-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 85vh;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 10px 10px 0 0;
        background: #222;
        z-index: 999;
        padding: 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
    }

    .responsive-popup table {
        font-size: 14px;
        width: 100%;
    }

    .responsive-popup button {
        width: 100%;
        margin-top: 10px;
    }

    #popupLanesTable {
        overflow-x: auto;
        max-width: 100%;
        display: block;
    }
}

#tractor-camera,
#tractor-analysis {
  max-width: 100%;   /* fyller bredden */
  height: auto;      /* behåller proportioner */
  display: block;
  margin: 0 auto;    /* centrerar */
}

.snapshot-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .snapshot-container {
    flex-direction: row; /* visar bilder sida vid sida på större skärm */
    justify-content: center;
  }
  #tractor-camera,
  #tractor-analysis {
    max-width: 48%;  /* båda ryms bredvid varandra */
  }
}
