/* Core Bootstrapping */
.bootstrapping body {
    opacity: 0 !important;
    pointer-events: none !important;
}

body {
    transition: opacity 0.2s ease-in-out;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: minmax(380px, 480px) 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
    margin-top: 100px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}


.dashboard.no-map {
    grid-template-columns: 1fr;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 8px;
}

/* ... (unchanged) ... */

/* Responsive Overrides */
@media (max-width: 992px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .visualization-area {
        position: static;
    }
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.visualization-area {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: sticky;
    top: 90px;
}

/* Premium Card Overrides */
.card-premium {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(0, 0, 0, 0.9) 100%);
    border-left: 4px solid var(--primary);
}

.card-results {
    background: rgba(15, 23, 42, 0.4);
    padding: 1.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.btn-action:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Table Scroll */
.table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

/* Map Premium */
.map-container-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.map-header-premium {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.map-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 700;
}

.map-controls-premium {
    display: flex;
    gap: 0.5rem;
}

.premium-map {
    width: 100%;
    height: 520px;
}

/* Raw Output Sidebar */
.card-raw {
    background: #050505;
    border: 1px solid #333;
    padding: 1rem;
    position: relative;
}

#raw-output-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #00ff00;
    /* Classic Terminal Green */
    background: #000;
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.4;
}

#map-3d {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* Ensure the terminal box is visible on top */
#raw-output-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 600px;
    z-index: 3000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

#close-raw {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

#close-raw:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(90deg);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#download-capture-area {
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Conclusion Overlay for Image Export */
.conclusion-overlay {
    position: absolute;
    bottom: 0px;
    left: 0px;
    right: 0px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    border-radius: 12px;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.conclusion-brand {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.conclusion-summary {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.conclusion-footer {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* MTR Table Specifics */
#mtr-table th,
#mtr-table td {
    padding: 0.8rem 0.5rem;
    font-size: 0.8rem;
}

#mtr-table .latency-value {
    font-family: 'Orbitron', monospace;
    color: var(--primary);
}

/* Info Card Legend */
.legend-premium {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.fast {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.dot.moderate {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.dot.slow {
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
}

/* Glow Utilities */
.button-primary-glow:hover {
    box-shadow: 0 0 25px var(--primary-glow);
}

/* Transitions */
.tool-section {
    transition: all 0.4s ease;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .visualization-area {
        position: static;
    }
}

/* Inherit core styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&family=Orbitron:wght@400;700&display=swap');

:root {
    /* Premium Indigo Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --secondary: #0f172a;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;

    /* Backgrounds with modern depth */
    --bg-amoled: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.7);

    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(79, 70, 229, 0.2);

    --card-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: var(--bg-amoled);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1000;
    height: 70px;
}


.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

.brand h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1;
    color: var(--text-main);
}

.subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-tabs {
    display: flex;
    gap: 0.8rem;
}

.nav-tab {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.nav-tab:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.tool-section {
    display: none;
}

.tool-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}


.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

h3 {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-ready {
    background: rgba(22, 163, 74, 0.1);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.status-running {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Buttons */
.button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: none;
    letter-spacing: 0.2px;
    font-family: inherit;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
}

.button:active {
    transform: translateY(0);
}


.button-full {
    width: 100%;
}

/* Professional Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 1.25rem 1rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    font-size: 0.9rem;
    color: var(--text-main);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
    border-bottom: none;
}


.hop-badge {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
}

.latency {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
}

.stat-card-wide {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .stat-card-wide {
        grid-column: span 1;
    }
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

/* Section Text */
.section-title {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin: 1.5rem 0 0.8rem;
    font-weight: 700;
    font-size: 1rem;
}

.section-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Leaflet Overrides */
.leaflet-container {
    background: #000 !important;
}

#map-2d,
#map-3d,
#ping-map {
    /* Sizing handled via JS */
    box-sizing: border-box;
}

#tool-guide-section .guide-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }
}

/* --- RE-APPLIED STYLES --- */

.map-hidden {
    display: none !important;
}

/* New Navigation Styles (Desktop) */
.nav-menu {
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-item:hover .nav-link {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-arrow {
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 320px;
    background: rgba(10, 11, 16, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.nav-item:hover .dropdown-menu,
.nav-item.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
    color: var(--text-muted);
    text-decoration: none;
}

.menu-item:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--text-main);
}

.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.menu-item:hover .item-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.item-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Footer Styles */
.footer {
    border-top: 1px solid var(--border-color);
    background: #050505;
    margin-top: 4rem;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
    padding-top: 4rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.footer-logo img {
    width: 32px;
    height: 32px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #555;
    margin-top: auto;
}

.footer-col h4 {
    font-size: 0.8rem;
    color: white;
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
}

.footer-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    transition: var(--transition);
    cursor: pointer;
}

.footer-link:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-promo-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    transition: var(--transition);
}

.footer-promo-card:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.2);
    transform: translateY(-2px);
}

.promo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.promo-badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-promo-card h5 {
    font-size: 0.85rem;
    color: white;
    margin: 0;
}

.footer-promo-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.promo-btn {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.promo-btn:hover {
    color: var(--text-main);
    transform: translateX(4px);
}

/* Guide Card Fix */
#tool-guide-section {
    height: fit-content !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* DNS Propagation grid override - force single column */
#prop-grid {
    display: block !important;
    grid-template-columns: none !important;
}

#tool-guide-section .guide-icon {
    min-width: 40px;
    height: 40px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

#tool-guide-section .guide-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

/* ==============================
   HAMBURGER MENU BUTTON
   ============================== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==============================
   RESPONSIVE: Tablet (≤1200px)
   ============================== */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: minmax(300px, 400px) 1fr;
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.72rem;
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }

    .nav-menu {
        gap: 0.8rem;
    }
}

/* ==============================
   RESPONSIVE: Mobile Landscape (≤992px)
   ============================== */
@media (max-width: 992px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: rgba(8, 10, 18, 0.98);
        backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 80px 1.5rem 2rem;
        z-index: 1050;
        border-left: 1px solid var(--border-color);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
        gap: 0.25rem;
    }

    /* Support theme switcher positioning on mobile */
    .nav-actions-mobile {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        z-index: 1100;
    }

    .theme-switcher {
        margin-left: 0;
    }

    .nav-menu.mobile-open {
        display: flex;
    }

    .nav-item {
        height: auto;
    }

    .nav-item.has-dropdown {
        flex-direction: column;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
        box-shadow: none;
        border: none;
        padding: 0;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 8px;
    }

    .nav-item.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 600px;
        padding: 0.5rem;
        transform: none;
    }

    .nav-item:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        padding: 0;
    }

    .nav-item.open:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 600px;
        padding: 0.5rem;
    }

    .dropdown-arrow {
        transition: transform 0.3s ease;
    }

    .nav-item.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-item:hover .dropdown-arrow {
        transform: none;
    }

    .nav-item.open:hover .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dashboard {
        grid-template-columns: 1fr;
        margin-top: 70px;
    }

    .visualization-area {
        position: static;
    }

    .sidebar {
        max-height: none;
        overflow-y: visible;
    }

    .brand h1 {
        font-size: 1rem;
        flex-shrink: 1;
    }

    .brand-divider,
    .brand-partner {
        display: none;
    }
}

/* ==============================
   RESPONSIVE: Mobile Portrait (≤768px)
   ============================== */
@media (max-width: 768px) {
    .dashboard {
        padding: 0 0.75rem 1rem;
        margin-top: 65px;
    }

    .card {
        border-radius: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .premium-table,
    #traceroute-table,
    #mtr-table {
        min-width: 600px;
    }

    .map-header-premium {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .premium-map {
        min-height: 300px;
    }

    #tool-guide-section {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }
}

/* ==============================
   RESPONSIVE: Small Mobile (≤480px)
   ============================== */
@media (max-width: 480px) {
    .dashboard {
        padding: 0 0.5rem 0.5rem;
        margin-top: 60px;
    }

    .brand-logo {
        width: 20px;
        height: 20px;
    }

    .brand h1 {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .brand-main {
        gap: 6px;
        flex-shrink: 1;
        min-width: 0;
    }

    .brand-main img {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .nav-container {
        padding: 0 0.5rem !important;
    }

    .nav-actions-mobile {
        gap: 0.25rem;
    }

    .form-group label {
        font-size: 0.75rem;
    }

    .button-full {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-menu {
        width: 100%;
    }

    h2 {
        font-size: 1rem;
    }

    .map-controls-premium {
        flex-wrap: wrap;
    }

    .vulnerability-grid {
        grid-template-columns: 1fr;
    }

    /* Sparkline & Trends */
    .stat-trend-spark {
        height: 40px !important;
        width: 100%;
        margin-top: 5px;
    }

    .sparkline-container {
        display: flex;
        align-items: flex-end;
        gap: 1px;
        height: 100%;
        width: 100%;
    }

    .spark-bar {
        flex: 1;
        min-width: 1px;
        background: var(--primary);
        border-radius: 1px 1px 0 0;
        transition: height 0.3s ease;
    }

    .spark-bar.fast {
        background: #22c55e;
    }

    .spark-bar.moderate {
        background: #eab308;
    }

    .spark-bar.slow {
        background: #ef4444;
    }
}

/* Toast Notifications — Added for copy feedback */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    align-items: center;
}

.toast-notification {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toast-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.fading {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-icon {
    font-size: 1.1rem;
}

@keyframes toast-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Micro-animations Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}