/* Globala stilar för inline-ikoner */
.icon-inline {
    margin-right: 0.5rem;
    font-size: 1.2em;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla", "Android Emoji", "emoji", sans-serif;
    vertical-align: -0.1em;
}

/* Grundläggande återställning */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Förhindrar horisontell overflow och tillåter touch-gester */
html, body {
    overflow-x: hidden;
    touch-action: pan-x pan-y;
}

/* Huvud-body-stilar */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1d1d1f;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Förhindrar scrollning när mobilmenyn är öppen */
body.menu-open {
    overflow: hidden;
}

/* Stilar för mörkt läge */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #f5f5f7;
}

body.dark-mode .main-header {
    background: rgba(28, 28, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .main-ip-card,
body.dark-mode .tool-card,
body.dark-mode .seo-article-container {
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-title,
body.dark-mode .tool-title,
body.dark-mode .section-title,
body.dark-mode .seo-article-content h2,
body.dark-mode .seo-article-content h3,
body.dark-mode .seo-article-content h4 {
    color: #f5f5f7;
}

body.dark-mode .info-sheet-label {
    color: #98989d;
}

body.dark-mode .info-sheet-value,
body.dark-mode .detail-value {
    color: #f5f5f7;
}

body.dark-mode .details-title {
    color: #f5f5f7;
}

body.dark-mode .detail-label {
    color: #98989d;
}

body.dark-mode .info-sheet {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    border: 1px solid #3a3a3c;
}

body.dark-mode .tool-card p, body.dark-mode .seo-article-content p {
     color: #a1a1a6;
}

body.dark-mode .detailed-results,
body.dark-mode .detailed-results-zone {
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .detail-item {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
}

body.dark-mode .form-field {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #f5f5f7;
}

body.dark-mode .form-field::placeholder {
    color: #8e8e93;
}

body.dark-mode .help-text {
    color: #8e8e93;
}
    
body.dark-mode .main-footer {
    background: #1c1c1e;
    color: #f5f5f7;
    border-top-color: #30363d;
}
 body.dark-mode .footer-legal-links a {
    color: #bdc3c7;
}

/* Modal-stilar i mörkt läge */
body.dark-mode .modal-content {
    background: #1c1c1e; 
    color: #f5f5f7;
}
body.dark-mode .modal-close-btn { color: #a1a1a6; }
body.dark-mode #modal-body h2, body.dark-mode #modal-body h3 { color: #f5f5f7; }
body.dark-mode #modal-body p, body.dark-mode #modal-body li { color: #c9c9c9; }
body.dark-mode #modal-body a { color: #58a6ff; }

/* Speciell titelstil med färggradient */
body.dark-mode .card-title.special-card-title {
    background: linear-gradient(135deg, #e0e0e0, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.card-title.special-card-title {
    background: linear-gradient(135deg, #1d2b38, #345f80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Container-layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ljus/mörk tema-omkopplare */
.theme-switcher {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007AFF;
    margin-left: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.theme-switcher:hover {
    transform: scale(1.1);
}

.dark-theme-icon { display: none; }
.light-theme-icon { display: block; }
body.dark-mode .dark-theme-icon { display: block; }
body.dark-mode .light-theme-icon { display: none; }
body.dark-mode .theme-switcher { color: #58a6ff; }

/* Huvudinnehållsområde */
.main {
    padding: 2rem 0 3rem 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1d1d1f;
    text-align: center;
}

/* Innehållskort-stilar */
.main-ip-card, .tool-card, .seo-article-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
}

.card-title, .tool-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1d1d1f;
    text-align: center;
}

#ip-protocol-display {
    word-break: break-all;
    line-height: 1.4;
}

.main-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: stretch;
}

.primary-info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: left;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.primary-info-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.primary-info-card.clickable {
    cursor: pointer;
}

body.dark-mode .primary-info-card {
    background: #1c1c1e;
    border-color: #3a3a3c;
}
body.dark-mode .primary-info-card.clickable:hover {
    border-color: #5f5f61;
}

.info-card-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-card-icon {
    color: #007AFF;
}
body.dark-mode .info-card-icon {
    color: #58a6ff;
}

.info-card-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}
body.dark-mode .info-card-label {
    color: #adb5bd;
}

.ip-values-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch; 
    gap: 0.5rem;
}

.ip-separator {
    width: 80%;
    margin: 0.5rem auto; 
    border: none;
    height: 1px;
    background-color: #e5e7eb;
}
body.dark-mode .ip-separator {
    background-color: #3a3a3c;
}

.info-card-value {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    overflow-wrap: break-word;
}
.info-card-value span {
    word-break: break-all;
}
body.dark-mode .info-card-value {
    color: #f5f5f7;
}

.info-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}
body.dark-mode .info-label {
    color: #adb5bd;
}

.info-card-value-loc {
    font-weight: 500;
    color: #1d1d1f;
    line-height: 1.6;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}
body.dark-mode .info-card-value-loc {
    color: #f5f5f7;
}

.loc-item {
    display: flex;
    align-items: flex-start; 
    font-size: 0.95rem; 
    margin-bottom: 0.5rem;
}
.loc-item:last-child {
    margin-bottom: 0;
}
.loc-item strong {
    color: #6c757d;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
    min-width: 90px;
}
.loc-item span {
    overflow-wrap: break-word; 
}
body.dark-mode .loc-item strong {
    color: #adb5bd;
}

.info-card-separator {
    width: 100%;
    border: none;
    height: 1px;
    background-color: #f0f2f5;
    margin: 1rem 0 0.8rem 0;
}
body.dark-mode .info-card-separator {
    background-color: #3a3a3c;
}

/* Anslutningskvalitetsindikator */
.quality-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}
.quality-indicator.excellent {
    background-color: #e8f5e9;
    color: #2e7d32;
}
.quality-indicator.good {
    background-color: #fff3e0;
    color: #ef6c00;
}
.quality-indicator.suspect {
    background-color: #ffebee;
    color: #c62828;
}
body.dark-mode .quality-indicator.excellent {
    background-color: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
}
body.dark-mode .quality-indicator.good {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ffcc80;
}
body.dark-mode .quality-indicator.suspect {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ef9a9a;
}

.ip-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.info-sheet {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.info-sheet-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.info-sheet-icon {
    width: 36px;
    height: 36px;
    padding: 7px;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border-radius: 10px;
    color: white;
    flex-shrink: 0;
}
.info-sheet-label {
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
}
.info-sheet-value {
    font-size: 1.05rem;
    color: #1d1d1f;
    font-weight: 500;
    word-break: break-word;
}

/* Kart-stilar */
#ip-location-map, #location-map, #main-ip-map {
    height: 350px;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Centrerad knappgrupp */
.centered-button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.btn-details, .btn-network-report {
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-details {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.25);
}
.btn-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.btn-network-report {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.25);
}
.btn-network-report:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.35);
}

/* Verktygskort-stilar */
.tool-card p {
    text-align: center;
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.form-group {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.form-field {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #1d1d1f;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

/* --- Valideringsstilar --- */
.form-field.is-valid {
    border-color: #34C759; /* Grön */
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

.form-field.is-invalid {
    border-color: #FF3B30; /* Röd */
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.2);
}

/* Valideringsstilar i mörkt läge */
body.dark-mode .form-field.is-valid {
    border-color: #30D158; /* Mörkgrön */
    box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.2);
}

body.dark-mode .form-field.is-invalid {
    border-color: #FF453A; /* Mörkröd */
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.2);
}
/* --- Slut på valideringsstilar --- */


.form-button {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.form-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-print {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}
.btn-print:hover {
    background-color: #e9ecef;
}
body.dark-mode .btn-print {
    background-color: #343a40;
    color: #f8f9fa;
    border-color: #495057;
}
body.dark-mode .btn-print:hover {
    background-color: #495057;
}

.help-text {
    font-size: 0.85rem;
    color: #777;
    text-align: center;
    margin-top: 0.8rem;
}

/* Laddningsindikator */
.loading-indicator {
    text-align: center;
    padding: 1.5rem;
    color: #666;
    font-size: 0.95rem;
}
.loading-indicator .spinner {
    width: 22px; height: 22px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 0.6rem;
    vertical-align: -0.3em;
}
@keyframes spin { to { transform: rotate(360deg); } }

body.dark-mode .loading-indicator { color: #bbb; }
body.dark-mode .loading-indicator .spinner {
    border-color: rgba(255,255,255,0.15);
    border-top-color: #58a6ff;
}

/* Resultatcontainer */
.detailed-results, .detailed-results-zone {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
.details-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #1d1d1f;
    text-align: left;
}
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.8rem;
}
.detail-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border: 1px solid #eee;
}
.detail-label {
    font-weight: 600;
    color: #444;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    display: block;
}
.detail-value {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    color: #121212;
    font-size: 0.9rem;
    word-break: break-all;
}

/* Footer */
.main-footer {
    background: #f0f2f5;
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid #dde1e6;
    font-size: 0.9rem;
    color: #555;
}
.footer-legal-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.8rem;
}
.footer-legal-links a {
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
}

/* Modal-fönster */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
.modal.active {
    opacity: 1;
}
.modal-content {
    background: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    position: relative;
}
.modal-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.modal-details-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.modal-details-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.modal-details-list li:last-child {
    border-bottom: none;
}
.modal-details-list li strong {
    color: #555;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}
.modal-details-list li span,
.modal-details-list li .value-with-button {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    text-align: right;
    overflow-wrap: break-word;
    word-break: break-all;
}
body.dark-mode .modal-details-list li {
    border-bottom-color: #3a3a3c;
}
body.dark-mode .modal-details-list li strong {
    color: #bbb;
}

.value-with-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.btn-copy-modal {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.btn-copy-modal:hover {
    opacity: 1;
}
.btn-copy-modal:disabled {
    cursor: default;
    opacity: 1;
    color: #2e7d32;
}
body.dark-mode .btn-copy-modal:disabled {
    color: #a5d6a7;
}

/* --- SEO-artikel-stilar --- */
.seo-article-content {
    text-align: left;
    line-height: 1.7;
}
.seo-article-content h2, .seo-article-content h3, .seo-article-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.seo-article-content h2 { font-size: 1.8rem; }
.seo-article-content h3 { font-size: 1.5rem; }
.seo-article-content h4 { font-size: 1.2rem; }
.seo-article-content p, .seo-article-content li {
    font-size: 1rem;
    margin-bottom: 1rem;
}
.seo-article-content ul, .seo-article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.seo-article-content a {
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
}
.seo-article-content a:hover {
    text-decoration: underline;
}
body.dark-mode .seo-article-content a {
    color: #58a6ff;
}

/* SEO-tabell */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.seo-table th, .seo-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}
.seo-table caption {
    caption-side: bottom;
    padding: 10px;
    font-size: 0.85rem;
    color: #777;
    text-align: center;
}
.seo-table thead tr {
    background-color: #f8f9fa;
}
.seo-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.seo-table tbody tr:nth-of-type(even) {
    background-color: #fdfdfd;
}
body.dark-mode .seo-table {
    box-shadow: none;
}
body.dark-mode .seo-table th, body.dark-mode .seo-table td {
    border-color: #3a3a3c;
}
body.dark-mode .seo-table thead tr {
    background-color: #2c2c2e;
}
body.dark-mode .seo-table tbody tr:nth-of-type(even) {
    background-color: #222224;
}
body.dark-mode .seo-table caption {
    color: #8e8e93;
}

/* Callout-boxar */
.callout-box {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    border-left: 5px solid;
}
.callout-box .callout-icon {
    font-size: 1.8rem;
    margin-right: 1.2rem;
    line-height: 1;
}
.callout-box .callout-content h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.callout-box .callout-content p {
    margin-bottom: 0;
}

.callout-box.info { background-color: #e7f3fe; border-color: #2196F3; }
.callout-box.tip { background-color: #e8f5e9; border-color: #4CAF50; }
.callout-box.warning { background-color: #fff3e0; border-color: #ff9800; }

body.dark-mode .callout-box { color: #f5f5f7; }
body.dark-mode .callout-box.info { background-color: rgba(33, 150, 243, 0.15); }
body.dark-mode .callout-box.tip { background-color: rgba(76, 175, 80, 0.15); }
body.dark-mode .callout-box.warning { background-color: rgba(255, 152, 0, 0.15); }

/* --- Navigation --- */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}
.nav-link:hover, .nav-link.active {
    color: #007AFF;
    background-color: rgba(0, 122, 255, 0.1);
}
body.dark-mode .nav-link {
    color: #bbb;
}
body.dark-mode .nav-link:hover, body.dark-mode .nav-link.active {
    color: #58a6ff;
    background-color: rgba(88, 166, 255, 0.1);
}

.nav-dropdown {
    position: relative;
}
.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7em;
    margin-left: 4px;
}
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1001;
}
body.dark-mode .dropdown-content {
    background-color: #2c2c2e;
    border-color: rgba(255,255,255,0.15);
}
.nav-dropdown.active .dropdown-content {
    display: block;
}
.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.dropdown-item:hover {
    background-color: rgba(0, 122, 255, 0.1);
}
body.dark-mode .dropdown-item {
    color: #eee;
}
body.dark-mode .dropdown-item:hover {
    background-color: rgba(88, 166, 255, 0.1);
}
.mobile-nav-toggle { display: none; }


/* --- Verktygspresentation (Framsidan) --- */
.tools-showcase {
    padding: 2.5rem 0;
    margin-top: 2.5rem;
}
.tools-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.showcase-tool-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.showcase-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}
body.dark-mode .showcase-tool-card {
    background: #1c1c1e;
    border-color: #3a3a3c;
}
.showcase-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}
.showcase-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
body.dark-mode .showcase-title { color: #f5f5f7; }
.showcase-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}
body.dark-mode .showcase-description { color: #a1a1a6; }


/* --- Sökhistorik --- */
.history-zone {
    margin: 0.5rem 0 1rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}
body.dark-mode .history-zone { color: #aaa; }
.history-label {
    font-weight: 500;
    margin-right: 0.5rem;
}
.history-item {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-decoration: none;
    margin: 0.2rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.history-item:hover {
    background-color: #dce1e6;
    transform: translateY(-1px);
}
body.dark-mode .history-item {
    background-color: #3a3a3c;
    color: #f0f0f0;
}
body.dark-mode .history-item:hover {
    background-color: #4f4f52;
}

.btn-clear-history {
    background: none;
    border: 1px solid #ccc;
    color: #888;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: all 0.2s ease;
}
.btn-clear-history:hover {
    background-color: #f0f0f0;
    color: #333;
    border-color: #bbb;
}
body.dark-mode .btn-clear-history {
    border-color: #4f4f52;
    color: #999;
}
body.dark-mode .btn-clear-history:hover {
    background-color: #3a3a3c;
    color: #eee;
    border-color: #5f5f61;
}


/* --- WHOIS-resultat --- */
.whois-data {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.85em;
    line-height: 1.6;
    color: #24292e;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}
body.dark-mode .whois-data {
    background-color: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

/* --- FAQ-sektion --- */
.faq-section {
    max-width: 800px;
    margin: 3rem auto 0 auto;
}
.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}
.faq-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    transition: color 0.2s ease;
}
.faq-item.active .faq-question, .faq-question:hover {
    color: #007AFF;
}
.faq-question::after {
    content: '▼';
    font-size: 0.9em;
    transition: transform 0.3s ease;
    margin-left: 1rem;
}
.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}
.faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: #555;
    line-height: 1.7;
    display: none;
    font-size: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
}
.faq-answer p:last-child {
    margin-bottom: 0;
}
.faq-item.active .faq-answer {
    display: block;
}
body.dark-mode .faq-item {
    background: #1c1c1e;
    border-color: #3a3a3c;
}
body.dark-mode .faq-question {
    color: #f5f5f7;
}
body.dark-mode .faq-item.active .faq-question, body.dark-mode .faq-question:hover {
    color: #58a6ff;
}
body.dark-mode .faq-answer {
    color: #a1a1a6;
    border-top-color: #3a3a3c;
}


/* --- 404-felsida --- */
.error-subtext {
    text-align: center;
    font-size: 1.1rem;
    margin-top: -1rem;
    margin-bottom: 2rem;
}
.content-404 {
    text-align: center;
}
.error-links-list {
    list-style-type: none;
    padding: 0;
    margin: 2rem 0;
}
.error-links-item {
    margin-bottom: 0.5rem;
}
.error-links-item-main {
    margin-bottom: 1rem;
}


/* --- Responsiva stilar --- */
@media (max-width: 992px) {
    .main-info-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
     .whois-data {
        overflow-x: auto;
    }
    
    .detail-value {
        word-wrap: break-word;
    }
    .footer-legal-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem 1.5rem;
    }

    .footer-legal-links a {
        text-align: center;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        max-height: calc(100vh - 65px); /* Justera höjden på headern */
        overflow-y: auto;
    }
    .main-navigation.active { display: flex; }
    body.dark-mode .main-navigation {
        background: rgba(28, 28, 30, 0.98);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .nav-link { 
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }

    .nav-dropdown .dropdown-content {
        position: static;
        display: block;
        border: none;
        box-shadow: none;
        background: none;
        padding: 0;
    }
    .nav-dropdown.active .dropdown-toggle::after { transform: rotate(180deg); }
    .nav-dropdown .dropdown-item {
        padding-left: 2rem;
        background-color: rgba(0,0,0,0.03);
    }
    body.dark-mode .nav-dropdown .dropdown-item {
        background-color: rgba(255,255,255,0.05);
    }
    
    .mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
        margin-left: 1rem;
    }
    .mobile-nav-toggle span {
        width: 30px;
        height: 3px;
        background: #333;
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
        transform-origin: 1px;
    }
    body.dark-mode .mobile-nav-toggle span {
        background: #f5f5f7;
    }

    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg);
    }
    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }

    .main-ip-card, .tool-card, .seo-article-container { padding: 1.5rem; }
    
    .ip-values-container .info-card-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    .info-card-value .info-label {
        font-size: 0.9rem;
    }
    .info-card-value span:not(.info-label) {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .loc-item { font-size: 0.9rem; }
    .loc-item strong { min-width: 85px; }


    .ip-info-grid { grid-template-columns: 1fr; }
    .form-group { flex-direction: column; }
    #ip-location-map, #location-map, #main-ip-map { height: 250px; }

    .seo-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-details-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .modal-details-list li span,
    .modal-details-list li .value-with-button {
        text-align: left;
        width: 100%; 
    }
    .value-with-button {
        justify-content: space-between;
    }
}

@media (max-width: 400px) {
    .site-logo {
        font-size: 1.4rem;
    }
}
/* Korrigering för IP-visning på mobil */
@media (max-width: 480px) {
  #ip-protocol-display {
    font-size: 1.1rem !important; /* Minskar teckenstorleken på små skärmar */
    word-wrap: break-word;     /* Säkerställer att långa adresser kan brytas korrekt */
  }
}