:root {
    --bg-color: #212529;
    --card-bg: #2c3034;
    --text-color: #e9ecef;
    --border-color: #495057;
    --header-bg: #1a1d20;
}

[data-bs-theme="light"] {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --border-color: rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
    padding-top: 0;
}

.header-area {
    background: var(--header-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-left p {
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
}

.header-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-right ul li {
    margin-left: 20px;
}

.header-right ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-right ul li a:hover {
    color: #007bff;
}

.dashboard-header {
    padding: 30px 0;
    text-align: center;
    background: var(--card-bg);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    color: var(--text-color);
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.95em;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

.card {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--border-color);
    background: var(--card-bg);
    border-color: var(--border-color);
}

.summary-tile {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    background: var(--card-bg);
    box-shadow: 0 2px 4px var(--border-color);
}

.breach-count {
    font-size: 2em;
    font-weight: bold;
    color: #dc3545;
}

.risk-score {
    font-size: 2em;
    font-weight: bold;
    color: #ffc107;
}

.email-count {
    font-size: 2em;
    font-weight: bold;
    color: #0d6efd;
}

#visualization {
    height: 700px;
    min-height: 500px;
    max-height: none;
    overflow: auto;
    position: relative;
    min-width: 100%;
    transition: all 0.3s ease-in-out;
}

#visualization svg {
    min-width: 800px;
    display: block;
}

#visualization::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#visualization::-webkit-scrollbar-track {
    background: var(--bg-color);
}

#visualization::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

#visualization::-webkit-scrollbar-thumb:hover {
    background: #0d6efd;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    min-width: 100%;
}

.table-responsive table {
    margin-bottom: 0;
    min-width: 800px;
}

.dataTables_wrapper {
    width: 100%;
    overflow: hidden;
}

.dataTables_length select {
    min-width: 60px;
    max-width: 120px;
}

.dataTables_wrapper .row {
    margin: 0;
    width: 100%;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 10px;
}

.dataTables_wrapper .dataTables_paginate {
    margin: 0;
    white-space: nowrap;
    text-align: right;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3em 0.8em;
}

.footer {
    margin-top: 50px;
    padding: 25px 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    position: relative;
    width: 100%;
}

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

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #007bff;
    text-decoration: underline;
}

.footer .mx-2 {
    color: var(--text-color);
    opacity: 0.5;
}

.theme-toggle {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 2px 4px var(--border-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--border-color);
}

.container-fluid {
    padding-bottom: 20px;
}

.node {
    cursor: pointer;
}

.link {
    stroke: #999;
    stroke-opacity: 0.6;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-col {
    flex: 1;
    min-width: 300px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 100px;
    height: 100px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.filter-active {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

[data-bs-theme="dark"] .filter-active {
    border-color: #0dcaf0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.25) !important;
}

.form-control,
.form-select {
    background-color: var(--bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
    transition: all 0.3s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: #0dcaf0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.25) !important;
}

.twitter-typeahead {
    width: 100%;
}

.tt-input {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

.tt-menu {
    background-color: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.tt-suggestion {
    padding: 8px 12px;
    color: var(--text-color) !important;
}

.tt-suggestion:hover,
.tt-suggestion.tt-cursor {
    background-color: var(--border-color) !important;
    cursor: pointer;
}

.node-group circle {
    transition: filter 0.2s ease-in-out, stroke 0.2s ease-in-out;
    cursor: pointer;
}

.node-group:hover circle {
    filter: brightness(1.2);
}

.node-group.expanded circle {
    stroke: #ffc107;
    stroke-width: 3;
    filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.6));
}

.node-group .fa {
    pointer-events: none;
    transition: filter 0.2s ease-in-out;
}

.node-group:hover text:not(.fa) {
    text-decoration: underline;
}

.node-group.expanded .fa {
    filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.8));
}

.footer p {
    margin: 0;
    color: var(--text-color);
}

.badge {
    font-size: 0.8em;
    padding: 0.4em 0.6em;
}

.breach-link,
.email-link {
    text-decoration: none;
    color: inherit;
}

.breach-link:hover,
.email-link:hover {
    text-decoration: underline;
}

[data-bs-theme="dark"] .text-dark {
    color: #000 !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#visualizationCard.collapsed {
    display: none;
}

#toggleVisualization {
    display: flex;
    align-items: center;
    gap: 5px;
}

#toggleVisualization i {
    transition: transform 0.3s ease-in-out;
}

#toggleVisualization.collapsed i {
    transform: rotate(180deg);
}

#clearAllFilters {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

#clearAllFilters:hover {
    transform: scale(1.05);
}

#resetVisualization {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

#resetVisualization:hover {
    transform: scale(1.05);
}

#filterBadge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@media (min-width: 1200px) {
    #visualization {
        height: 800px;
        min-height: 600px;
    }
}

@media screen and (max-width: 767px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        float: none;
        padding: 5px;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 5px;
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 20px;
    }

    .card-body {
        padding: 15px;
    }

    #visualization {
        height: 350px;
        min-height: 350px;
    }

    .dataTables_wrapper {
        padding-bottom: 20px;
    }

    #resetVisualization span,
    #toggleVisualization span {
        display: none;
    }

    #filterBadge {
        font-size: 0.65rem;
    }

    .card-header.d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    .footer .row {
        text-align: center;
    }

    .footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 10px;
    }

    .footer .col-md-6:last-child {
        margin-bottom: 0;
    }

    .theme-toggle {
        margin-top: 10px;
    }

    .footer .mx-2 {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }
}

/* Footer Columns Styles */
.footer .container {
    max-width: 90% !important;
    width: 90% !important;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    margin: 0 0 30px 0;
    gap: 60px;
    text-align: left;
    padding: 0 40px;
}

.footer-group {
    flex: 1;
    min-width: 0;
}

.footer-group h6 {
    color: #2c3e50 !important;
    font-size: 0.95em !important;
    margin-bottom: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.footer-group a.footer-link {
    display: block;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.footer-group a.footer-link:hover {
    opacity: 1;
    background-color: rgba(63, 113, 243, 0.15);
    padding-left: 14px;
    color: #3f71f3 !important;
    text-decoration: none;
}

.footer-links-wrapper {
    display: block;
}

@media (max-width: 768px) {
    .footer-columns {
        flex-direction: column;
        text-align: left;
        gap: 0;
        padding: 0;
    }

    .footer-group {
        border-bottom: 1px solid #ebedef;
    }

    .footer-group h6 {
        cursor: pointer;
        padding: 15px 20px;
        margin: 0 !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .footer-group h6::after {
        content: '+';
        font-size: 20px;
        font-weight: 300;
        transition: transform 0.3s ease;
    }

    .footer-group.active h6::after {
        content: '−';
    }

    .footer-group .footer-links-wrapper {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0 20px;
    }

    .footer-group.active .footer-links-wrapper {
        max-height: 300px;
        padding: 0 20px 15px 20px;
    }

    .footer-group a.footer-link {
        text-align: left;
    }

    .footer-group a.footer-link:hover {
        padding-left: 10px;
    }
}

[data-theme="dark"] .footer-group h6 {
    color: #ffffff !important;
}

[data-theme="dark"] .footer-group {
    border-bottom-color: #2a2d40;
}

/* Back to Dashboard Button - Modern Style */
.back-btn-wrapper {
    text-align: center;
    padding: 30px 0;
}

.btn-back-dashboard {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--card-bg);
    border: 2px solid #3498db;
    border-radius: 50px;
    text-decoration: none !important;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.btn-back-dashboard::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-back-dashboard:hover::before {
    top: 0;
}

.btn-back-dashboard:hover {
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    border-color: #2980b9;
}

.btn-back-dashboard i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.btn-back-dashboard:hover i {
    transform: translateX(-4px);
}

.btn-header-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3498db;
    background: transparent;
    border: 2px solid #3498db;
    border-radius: 25px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.btn-header-back:hover {
    background: #3498db;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}