/* 1. GLOBAL RESET AND GEOMETRY */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 2. FOOTER STICKING */
.main-content {
    flex: 1 0 auto;
    padding-top: 20px;
}

footer {
    flex-shrink: 0;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 20px 0;
}

/* 3. LOGO */
#mainTitle {
    width: 308px;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    padding-bottom: 30px;
    display: block;
}

/* 4. BUTTONS (ORIGINAL COLORS) */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
}

.btn:focus,
input:focus,
select:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #2e7d32;
    color: white;
}

.btn-stop {
    background-color: #c62828;
    color: white;
}

.btn-secondary {
    background-color: #1565c0;
    color: white;
}

.btn-warning {
    background-color: #b71c1c;
    color: white;
}

/* 5. FORMS AND GROUPS */
.form-container {
    border: 1px solid #ddd;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    display: none;
    background: #fff;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 6. SETTINGS AND PROTOCOLS */
#protocol {
    display: flex;
    flex-direction: column;
}

#protocol label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-weight: normal;
}

#protocol input[type="checkbox"] {
    margin-right: 8px;
}

#settings nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#settings nav .right-buttons {
    display: flex;
    gap: 5px;
    /* Spacing between Add and Remove all */
}

#settings nav>.btn,
#settings nav .right-buttons>.btn {
    margin: 0;
}

/* 7. LISTS AND RESULTS */
.network-item {
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.network-item.clickable {
    cursor: pointer;
}

.network-item.clickable:hover {
    background-color: #f0f0f0;
}

.results {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* States */
.collapsed {
    display: none;
}

/* 8. DELETE NOTIFICATION STACK */
.delete-confirmation-stack {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
}

.delete-confirmation {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: 300px;
}

/* 9. RESPONSIVENESS */
@media (max-width: 600px) {
    body {
        padding: 0 10px;
    }

    .network-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 8px;
    }

    .network-item .item-buttons {
        flex-shrink: 0;
        display: flex;
        gap: 5px;
    }

    #settings nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    #settings nav .right-buttons {
        margin-top: 0;
        justify-content: flex-end;
    }

    .delete-confirmation {
        width: calc(100vw - 20px);
        right: 10px;
    }
}

.cookie-link {
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.2s;
}

.description {
    color: #333946;
}

/* Quick scan toggle switch */
.quick-scan-toggle {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    gap: 8px;
    margin-bottom: 0px;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked+.toggle-slider {
    background-color: #4CAF50;
    border-color: #388E3C;
}

.toggle-label input:checked+.toggle-slider::before {
    transform: translateX(26px);
}

.toggle-text {
    margin-left: 5px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .quick-scan-toggle {
        margin-right: 8px;
    }

    .toggle-text {
        white-space: normal;
        line-height: 1.2;
        max-width: 150px;
    }

    .toggle-slider {
        width: 44px;
        height: 22px;
    }

    .toggle-slider::before {
        width: 18px;
        height: 18px;
        top: 2px;
        left: 2px;
    }

    .toggle-label input:checked+.toggle-slider::before {
        transform: translateX(22px);
    }
}

.thread-limit-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.thread-limit-container input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0;
}

.thread-limit-container label {
    margin: 0;
    font-weight: normal;
    order: 2;
}

.thread-limit-container input {
    order: 1;
}

.gateway-octets-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.gateway-octets-container input[type="text"] {
    width: 200px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0;
}

.gateway-octets-container label {
    margin: 0;
    font-weight: normal;
    order: 2;
}

.gateway-octets-container input {
    order: 1;
}

.quick-scan-group {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    background-color: #f9f9f9;
}

.quick-scan-group .gateway-octets-container {
    margin-top: 15px;
    margin-bottom: 0;
}

/* Styles for collapsible/expandable sections */
.toggle-section {
    margin: 15px 0;
}

.toggle-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.toggle-header:hover {
    color: #1976d2;
}

.toggle-header::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s;
    color: #666;
}

.toggle-header.expanded::before {
    transform: rotate(90deg);
}

.toggle-content {
    padding: 15px 0 15px 20px;
    border-left: 2px solid #eee;
    margin-left: 5px;
}

.toggle-content.collapsed {
    display: none;
}

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #1976d2;
    border-radius: 50%;
    background-color: #1976d2;
    color: white;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    margin-left: 6px;
    padding: 0;
    vertical-align: middle;
    transition: background-color 0.2s, border-color 0.2s;
}

.info-icon:hover,
.info-icon:focus {
    background-color: #0d47a1;
    border-color: #0d47a1;
    outline: none;
}

.info-icon:active {
    transform: scale(0.95);
}

.quick-scan-details {
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f8f9fa;
    line-height: 1.5;
    color: #333;
}

.quick-scan-details p {
    margin: 0;
}

.quick-scan-details.collapsed {
    display: none;
}

#mainNav {
    position: relative;
}

.lang-switch {
    position: fixed;
    top: 12px;
    right: 16px;
}

.lang-switch a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
}

.lang-switch a:hover,
.lang-switch a:focus {
    text-decoration: underline;
}

.results-help {
    line-height: 1.6;
}

.results-help-toggle {
    cursor: pointer;
    color: #0066cc;
    font-weight: 700;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: medium;
}

.help-content {
    margin-top: 8px;
}

.help-content.visible {
    display: block;
}

.help-content.hidden {
    display: none;
}

#privacyTerms {
    margin-top: 10px;
}