/* Grunnfarger */
:root {
    --primary-color: #2c3e50;
    --hover-color: #e3f2fd;
    --border-color: #dcdde1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    color: var(--primary-color);
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    table-layout: auto;
    min-width: 100%;
    border: 1px solid #e0e0e0;
}

th, td {
    padding: 8px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 300px;
    border: 1px solid #e0e0e0;
}

th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
}

th span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.sortable .sort-icon {
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.5;
}

.sortable:hover, .sortable:focus {
    background: #34495e;
}

tr {
    transition: background 0.2s;
}

tr:hover, tr:hover td {
    background: var(--hover-color);
    color: #1a237e;
}

td:first-child {
    padding-left: 15px;
}

.empty-cell {
    color: #95a5a6;
    font-style: italic;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.link-list a {
    background: #ecf0f1;
    color: #3498db;
    text-decoration: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9em;
}

.link-list a:hover, tr:hover .link-list a {
    background: #2196f3;
    color: white;
}

/* Rearrange search fields to place labels above inputs */
.search-field {
    display: flex;
    flex-direction: column;
    margin-right: 12px;
    min-width: 120px;
}

.search-field label {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Modern input styling */
.search-field input,
.search-field select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-height: 36px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Specific dropdown styling */
.search-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23555' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px;
}

/* Hover and focus states */
.search-field input:hover,
.search-field select:hover {
    border-color: #aaa;
}

.search-field input:focus,
.search-field select:focus {
    border-color: #4285f4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* Search container layout */
.search-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end; /* Align items at the bottom */
    margin-bottom: 20px;
    gap: 12px;
}

.search-container button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background-color: #4285f4;
    color: white;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    vertical-align: middle;
    font-family: inherit; /* Maintain consistent font */
}

.search-container button:hover {
    background-color: var(--primary-color);
    ;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}
.table-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }
    th, td {
        max-width: 180px;
    }
}
