/* === FONTS === */
@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* === VARIABLES === */
:root {
    --color-primary: #0d6efd;
    --color-primary-dark: #0b5ed7;
    --color-text: #333;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-bg-light: #f8f9fa;
    --font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --label-width: 240px;
    --label-width-md: 180px;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === HEADER / MENU === */
#menu-main-wrapper {
    border-bottom: 1px solid var(--color-border);
    background: #fff;
}

#menu-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

#menu-main .logo img {
    height: 28px;
}

#menu-main .menu-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

#menu-main .menu-content .items {
    display: flex;
    gap: 25px;
}

#menu-main .menu-content .items a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 400;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

#menu-main .menu-content .items a:hover,
#menu-main .menu-content .items a.active {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

/* === CONTENT WRAPPER === */
#content-wrapper {
    flex: 1;
    padding: 20px 0 40px;
}

/* === BREADCRUMBS === */
.breadcrumb {
    padding: 0;
    margin: 0 0 15px 0;
    background: none;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--color-text-muted);
    padding: 0 8px;
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-muted);
}

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 25px;
}

.page-header .h1_wrapper {
    position: relative;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    margin: 0 0 10px 0;
    color: var(--color-text);
}

.page-header h1 a {
    color: inherit;
    text-decoration: none;
}

.page-header .line {
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, transparent 100%);
    width: 100%;
    border-radius: 2px;
}

/* === TWO-COLUMN LAYOUT === */
.object-page {
    display: flex;
    gap: 30px;
}

.object-page.with-side {
    flex-direction: row;
}

.object-page-side {
    flex: 0 0 240px;
    min-width: 240px;
}

.object-page-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 991px) {
    .object-page.with-side {
        flex-direction: column;
    }

    .object-page-side {
        flex: none;
        min-width: auto;
        width: 100%;
    }
}

/* === SIDEBAR LIST GROUP === */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-bottom: none;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.list-group-item:first-child {
    border-radius: 4px 4px 0 0;
}

.list-group-item:last-child {
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 4px 4px;
}

.list-group-item:only-child {
    border-radius: 4px;
    border-bottom: 1px solid var(--color-border);
}

.list-group-item:hover {
    background: var(--color-bg-light);
    text-decoration: none;
}

.list-group-item.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.list-group-item.active + .list-group-item {
    border-top-color: var(--color-primary);
}

/* === CARDS === */
.card {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    margin-bottom: 20px;
    background: #fff;
}

.card-header {
    background: var(--color-bg-light);
    padding: 12px 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
}

.card-body {
    padding: 20px;
    --label-width: 240px;
}

/* === INFO BLOCKS (label + value) === */
.info {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.info:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info .lab {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.info .val {
    margin: 0;
    word-break: break-word;
}

.info .val a {
    color: var(--color-primary);
}

.info.inline {
    display: grid;
    grid-template-columns: var(--label-width) 1fr;
    gap: 15px;
    align-items: baseline;
    padding-bottom: 10px;
}

.info.inline .lab {
    margin-bottom: 0;
    text-align: right;
    padding-right: 10px;
    border-right: 2px solid #e9ecef;
}

.info.inline .val {
    min-width: 0;
}

@media (max-width: 768px) {
    .card-body {
        --label-width: 180px;
    }
}

@media (max-width: 576px) {
    .info.inline {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .info.inline .lab {
        text-align: left;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 3px;
        margin-bottom: 3px;
    }
}

/* === SEARCH FORM === */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: stretch;
}

.search-form .form-control,
.search-form .form-select {
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}

.search-form .form-control {
    min-width: 200px;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.search-form .btn {
    padding: 10px 25px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.search-form .btn:hover {
    background: var(--color-primary-dark);
}

/* === ALERTS === */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

/* === FOOTER === */
#footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 35px 0 25px;
    margin-top: auto;
}

#footer a {
    color: #ecf0f1;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo-and-menu {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.footer-logo img {
    height: 35px;
    opacity: 0.85;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.footer-menu-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copyright {
    font-size: 0.85rem;
    color: #95a5a6;
    margin: 0;
}

.footer-mission {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #3d5166;
}

.footer-mission a {
    color: #95a5a6;
}

@media (max-width: 767px) {
    .footer-inner,
    .footer-logo-and-menu {
        flex-direction: column;
        gap: 20px;
    }

    .footer-menu ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* === UTILITIES === */
.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.text-muted {
    color: var(--color-text-muted);
}

/* === SEARCH FORMS CONTAINER === */
.search-forms-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.search-form-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.search-form-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--color-text);
}

.search-form-card .search-form {
    margin-bottom: 0;
}

/* === HOSTS LIST === */
.hosts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.host-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--color-bg-light);
    border-radius: 4px;
    transition: background 0.2s;
}

.host-item:hover {
    background: #e9ecef;
}

.host-item a {
    font-weight: 500;
    color: var(--color-primary);
}

.host-id {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.hosts-count {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* === ID & IP LINKS === */
.id-link, .ip-link {
    color: var(--color-primary);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(13, 110, 253, 0.08);
    transition: all 0.2s;
}

.id-link:hover, .ip-link:hover {
    background: rgba(13, 110, 253, 0.15);
    text-decoration: none;
}

.domain-link {
    background: rgba(13, 110, 253, 0.08);
}

.page-link {
    background: rgba(25, 135, 84, 0.08);
    color: #198754;
}

.page-link:hover {
    background: rgba(25, 135, 84, 0.15);
}

.category-link {
    background: rgba(255, 193, 7, 0.15);
    color: #997404;
}

.category-link:hover {
    background: rgba(255, 193, 7, 0.25);
}

.feed-link {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.feed-link:hover {
    background: rgba(220, 53, 69, 0.15);
}

.badge-ipv6 {
    display: inline-block;
    padding: 2px 8px;
    background: #6c757d;
    color: white;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* === CONNECTIONS GRAPH === */
.connections-graph {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.graph-center {
    margin-bottom: 30px;
}

.graph-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
    min-width: 120px;
}

.graph-node:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.graph-node-center {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.graph-node-center:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.graph-node-disabled {
    opacity: 0.6;
    cursor: default;
}

.graph-node-disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
}

.node-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.node-icon-domain::before {
    content: "\1F310"; /* Globe emoji */
}

.node-icon-ip::before {
    content: "\1F4BB"; /* Computer emoji */
}

.node-icon-category::before {
    content: "\1F3F7"; /* Label emoji */
}

.node-icon-feed::before {
    content: "\1F4E1"; /* Satellite antenna emoji */
}

.node-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    max-width: 150px;
}

.graph-connections {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.graph-connection {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.connection-line {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--color-primary) 0%, var(--color-border) 100%);
    margin-bottom: 5px;
}

.connection-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

/* === RESPONSIVE GRAPH === */
@media (max-width: 767px) {
    .connections-graph {
        padding: 20px 15px;
    }

    .graph-connections {
        gap: 15px;
    }

    .graph-node {
        padding: 12px 15px;
        min-width: 100px;
    }

    .node-icon {
        width: 28px;
        height: 28px;
        font-size: 1.3rem;
    }

    .node-label {
        font-size: 0.8rem;
        max-width: 120px;
    }
}

/* === BADGE COUNT === */
.badge-count {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}


/* === RESPONSIVE SEARCH FORMS === */
@media (max-width: 576px) {
    .search-forms-container {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form .form-control,
    .search-form .form-select,
    .search-form .btn {
        width: 100%;
    }
}

/* === FORM DESCRIPTION === */
.form-description {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 15px 0;
}

/* === DOMAIN ACTIONS === */
.domain-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-action {
    display: inline-block;
    padding: 8px 16px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

/* === DATA TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table tr:hover td {
    background: rgba(13, 110, 253, 0.03);
}

.data-table .url-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === SMALL BUTTON === */
.btn-small {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 5px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

/* === PAGINATION === */
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* === POSTS LIST === */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-item {
    padding: 15px;
    background: var(--color-bg-light);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s;
}

.post-item:hover {
    border-color: var(--color-primary);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.post-title {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1rem;
}

.post-title:hover {
    text-decoration: underline;
}

.post-id {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.post-summary {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
}

/* === CONTENT PREVIEW === */
.content-preview {
    background: var(--color-bg-light);
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

/* === BADGES === */
.badge-warning {
    display: inline-block;
    padding: 2px 8px;
    background: #ffc107;
    color: #212529;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    display: inline-block;
    padding: 2px 8px;
    background: #198754;
    color: white;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-danger {
    display: inline-block;
    padding: 2px 8px;
    background: #dc3545;
    color: white;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* === RANKINGS GRID === */
.rankings-grid {
    /* Zachowaj spójność z innymi tabelami */
}

/* === IP INFO GRID === */
.ip-info-grid {
    /* Zachowaj spójność z innymi tabelami */
}

/* === RESPONSIVE TABLES === */
@media (max-width: 767px) {
    .data-table {
        display: block;
        overflow-x: auto;
    }

    .domain-actions {
        flex-direction: column;
    }

    .btn-action {
        text-align: center;
    }
}
