* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100dvh;
    padding: 2rem 1rem 3rem 1rem;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 1.5rem; /* Redusert litt for å spare plass på mobil */
}

.header h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.header p {
    color: #cbd5e1;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    line-height: 1.6;
    padding: 0 0.5rem;
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #334155;
    border-radius: 0.625rem;
    transition: all 0.3s ease;
    background: #0f172a;
    color: #e2e8f0;
    -webkit-appearance: none;
    appearance: none;
}

.search-box input:focus {
    outline: none;
    border-color: #06b6d4;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-box input::placeholder {
    color: #64748b;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

button {
    flex: 1;
    position: relative;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #4a5568;
    color: white;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: visible;
    display: flex;
    align-items: stretch;
    height: 3.5rem;
}

button .icon-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 4rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #06b6d4;
    z-index: 2;
    color: #1e293b;
    font-size: 1.5rem;
}

button::after {
    content: '';
    position: absolute;
    left: 4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 1.75rem 0 1.75rem 1.25rem;
    border-color: transparent transparent transparent #06b6d4;
    z-index: 3;
}

button span {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 6rem;
    padding-right: 1.5rem;
    position: relative;
    z-index: 4;
}

button:hover:not(:disabled) {
    background: #5a6578;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

button:hover:not(:disabled) .icon-wrapper {
    background: #0891b2;
}

button:hover:not(:disabled)::after {
    border-left-color: #0891b2;
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- RESULTAT-LISTEN --- */
#resultat {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultat.show {
    display: block;
}

.success {
    background: rgba(6, 182, 212, 0.1);
    border: 2px solid #06b6d4;
    color: #e2e8f0;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #e2e8f0;
}

.info {
    background: rgba(6, 182, 212, 0.1);
    border: 2px solid #06b6d4;
    color: #e2e8f0;
}

#resultat h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    line-height: 1.3;
}

#resultat p {
    margin: 0.625rem 0;
    line-height: 1.6;
}

.lenker {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lenke-knapp {
    position: relative;
    display: flex;
    align-items: stretch;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.05em;
    overflow: visible;
    background: #4a5568;
    color: white;
    height: 3.5rem;
    padding: 0;
    text-transform: uppercase;
}

.lenke-knapp::before {
    display: none;
}

.lenke-knapp .icon-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 4rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #1e293b;
    font-size: 1.5rem;
}

.lenke-knapp::after {
    content: '';
    position: absolute;
    left: 4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 1.75rem 0 1.75rem 1.25rem;
    border-color: transparent transparent transparent;
    z-index: 3;
}

.lenke-knapp span {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 6rem;
    padding-right: 1.5rem;
    text-align: left;
    position: relative;
    z-index: 4;
}

.lenke-knapp:hover {
    background: #5a6578;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.lenke-knapp.bruddkart .icon-wrapper {
    background-color: #ef4444;
}

.lenke-knapp.bruddkart::after {
    border-left-color: #ef4444;
}

.lenke-knapp.bruddkart:hover .icon-wrapper {
    background-color: #dc2626;
}

.lenke-knapp.bruddkart:hover::after {
    border-left-color: #dc2626;
}

.lenke-knapp.nettside .icon-wrapper {
    background-color: #06b6d4;
}

.lenke-knapp.nettside::after {
    border-left-color: #06b6d4;
}

.lenke-knapp.nettside:hover .icon-wrapper {
    background-color: #0891b2;
}

.lenke-knapp.nettside:hover::after {
    border-left-color: #0891b2;
}

.lenke-knapp.maps .icon-wrapper {
    background-color: #10b981;
}

.lenke-knapp.maps::after {
    border-left-color: #10b981;
}

.lenke-knapp.maps:hover .icon-wrapper {
    background-color: #059669;
}

.lenke-knapp.maps:hover::after {
    border-left-color: #059669;
}

.lenke-knapp.google-maps .icon-wrapper {
    background-color: #4285F4;
}

.lenke-knapp.google-maps::after {
    border-left-color: #4285F4;
}

.lenke-knapp.google-maps:hover .icon-wrapper {
    background-color: #1a73e8;
}

.lenke-knapp.google-maps:hover::after {
    border-left-color: #1a73e8;
}

.vaer-info {
    margin-top: 1.25rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 0.5rem;
}

.vaer-info h3 {
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    color: #06b6d4;
    margin-bottom: 0.75rem;
}

.vaer-loading {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.9rem;
}

.vaer-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.vaer-item {
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.375rem;
    text-align: center;
}

.vaer-item .label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.vaer-item .value {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    color: #e2e8f0;
}

.vaer-symbol {
    font-size: clamp(2rem, 8vw, 3rem);
    margin: 0.625rem 0;
    text-align: center;
}

.koordinater {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 1rem;
    padding: 0.875rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    border: 1px solid #334155;
    word-break: break-all;
}

.adresse-liste {
    margin-top: 1.25rem;
}

.adresse-item {
    padding: 1rem;
    margin: 0.625rem 0;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid #334155;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.adresse-item:hover,
.adresse-item:active {
    background: rgba(6, 182, 212, 0.1);
    border-color: #06b6d4;
    transform: translateX(5px);
}

.adresse-item strong {
    display: block;
    color: #06b6d4;
    margin-bottom: 0.375rem;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.adresse-item small {
    color: #94a3b8;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}

.admin-link {
    text-align: center;
    margin-top: 1rem;
    flex-shrink: 0;
}

.admin-link a {
    color: #06b6d4;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    padding: 0.5rem;
    display: inline-block;
}

.admin-link a:hover {
    color: #0891b2;
    text-decoration: underline;
}

/* Modal (Personvern & Hjelp) styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(3px);
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    margin: 10% auto; 
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    color: #e2e8f0;
    animation: fadeIn 0.3s;
}

.close-modal {
    color: #94a3b8;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #ef4444;
    text-decoration: none;
    cursor: pointer;
}

.privacy-link {
    cursor: pointer;
    color: #64748b;
    font-size: 0.75rem;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.privacy-link:hover {
    color: #06b6d4;
    text-decoration: underline;
}

/* Styles for help content */
.help-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.help-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}
.help-list li::before {
    content: '⚡';
    position: absolute;
    left: 0;
    color: #fbbf24;
}
.help-list strong {
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.25rem;
}
.help-list span {
    color: #94a3b8;
    font-size: 0.9rem;
}
.code-snippet {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    color: #06b6d4;
    font-family: monospace;
    font-size: 0.9em;
}

/* Media Queries */
@media (max-width: 575px) {
    button, .lenke-knapp {
        height: 3rem;
        font-size: 0.85rem;
    }
    button .icon-wrapper, .lenke-knapp .icon-wrapper {
        width: 3.5rem;
        font-size: 1.25rem;
    }
    button::after, .lenke-knapp::after {
        left: 3.5rem;
        border-width: 1.5rem 0 1.5rem 1rem;
    }
    button span, .lenke-knapp span {
        padding-left: 5.25rem;
    }
    .container {
        padding: 1rem;
    }
}
@media (min-width: 576px) {
    .container { padding: 2rem; }
    #resultat { padding: 1.75rem; }
}
@media (min-width: 768px) {
    body { padding: 1.5rem; }
    .container { padding: 2.5rem; }
    .header { margin-bottom: 2.5rem; }
    .search-box { margin-bottom: 2rem; }
    .button-group { margin-bottom: 2rem; }
    #resultat { padding: 2rem; }
    .vaer-data { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .container { padding: 2.5rem 3rem; }
}
@media (hover: none) and (pointer: coarse) {
    button, .lenke-knapp, .adresse-item { min-height: 44px; }
    .search-box input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: loading 1.4s infinite;
    margin-left: 5px;
}

@keyframes loading {
    0%, 80%, 100% { opacity: 0.6; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}