* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Эффект цифрового шума на фоне */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(0deg, transparent 0%, transparent 50%, rgba(255, 165, 0, 0.08) 50%, rgba(255, 165, 0, 0.08) 100%),
        repeating-linear-gradient(90deg, #000 0%, #000 2px, #0a0a1a 2px, #0a0a1a 4px);
    background-size: auto, 4px 4px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

/*.search-container {
    position: relative;
    width: 85%;
    max-width: 900px;
    margin: 200px auto 20px auto;
    transition: all 0.5s ease;
    z-index: 2;
} */

/* Контейнер поиска - начальное состояние (по центру) */
.search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 900px;
    transition: all 0.5s ease;
    z-index: 2;
}

.search-container.compact {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    margin: 0;
    z-index: 1000;
}

/* Когда поисковая строка поднята, уменьшаем отступ */
.search-container.compact ~ .results-container {
    margin-top: 150px; /* Меньше отступ, т.к. поисковая строка стала фиксированной */
}

.container {
    display: flex;
    align-items: center;
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px 25px;
    box-shadow:
        0 0 30px rgba(255, 165, 0, 0.4),
        0 0 60px rgba(255, 165, 0, 0.2);
    position: relative;
    z-index: 1;
}

.container::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #ffa500, #ffcc00, #ff9900);
    z-index: -1;
    border-radius: 14px;
    opacity: 0.3;
    filter: blur(8px);
}

.select-container {
    position: relative;
    margin-right: 20px;
}

.dropdown {
    appearance: none;
    -webkit-appearance: none;
    padding: 14px 40px 14px 15px;
    background: rgba(50, 25, 0, 0.8);
    border: 1px solid #ffa500;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffa500' width='24' height='24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

.dropdown:hover {
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.input-container {
    flex: 3;
}

.query-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(50, 25, 0, 0.7);
    border: 1px solid #ffa500;
    border-radius: 8px;
    color: #ffffff;
    font-size: 18px;
    outline: none;
    transition: all 0.3s ease;
}

.query-input:focus {
    border-color: #ffcc00;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.6);
}

.go-button {
    margin-left: 20px;
    padding: 16px 30px;
    background: linear-gradient(45deg, #ffa500, #ffcc00);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.go-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.go-button:hover {
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.7);
    transform: translateY(-1px);
}

.go-button:hover::before {
    opacity: 1;
}

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

/* Стили для контейнера результатов */
.results-container {
    margin-top: 180px; /* Достаточно места для поисковой строки */
    padding: 0 20px 20px 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 200px);
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-top: 20px;
}

/* Основная информация */
.main-info {
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(15px);
    margin-bottom: 0;
}


.main-info h2 {
    color: #ffa500;
    margin-bottom: 15px;
    font-size: 22px;
}

.info-divider {
    height: 2px;
    background: linear-gradient(90deg, #ffa500, transparent);
    margin-bottom: 20px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.info-label {
    color: #ccc;
    font-weight: bold;
}

.info-value {
    color: #fff;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* Секция портов */
.ports-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ports-container {
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(15px);
}

.ports-container h3 {
    color: #ffa500;
    margin-bottom: 20px;
    font-size: 20px;
}

.ports-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.port-item {
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid #ffa500;
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #fff;
}

.port-item:hover {
    background: rgba(255, 165, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 165, 0, 0.3);
}

.port-item.active {
    background: rgba(255, 165, 0, 0.6);
    border-color: #ffcc00;
}

.ports-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 165, 0, 0.3);
}

.show-all-ports {
    background: rgba(255, 165, 0, 0.3);
    border: 1px solid #ffa500;
    border-radius: 6px;
    color: #fff;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-all-ports:hover {
    background: rgba(255, 165, 0, 0.5);
}

/* Детали портов */
.port-details-container {
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(15px);
}

.port-details-container h3 {
    color: #ffa500;
    margin-bottom: 20px;
    font-size: 20px;
}

.port-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.port-detail-item {
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    background: rgba(20, 20, 40, 0.6);
}

.port-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
}

.port-title {
    color: #ffa500;
    font-size: 18px;
    font-weight: bold;
}

.port-timestamp {
    color: #ccc;
    font-size: 14px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #ffa500;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-content {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* Детали портов */
.port-details {
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(15px);
}

.port-detail-item {
    margin-bottom: 30px;
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    background: rgba(20, 20, 40, 0.6);
}

.port-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
}

.port-title {
    color: #ffa500;
    font-size: 18px;
    font-weight: bold;
}

.port-timestamp {
    color: #ccc;
    font-size: 14px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #ffa500;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-content {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* Сообщения об ошибках и статусах */
.not-found-message, .error-message {
    text-align: center;
    padding: 50px 20px;
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    margin: 20px auto;
    max-width: 600px;
}

.not-found-icon, .error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.not-found-message h3, .error-message h3 {
    color: #ffa500;
    margin-bottom: 15px;
    font-size: 24px;
}

.not-found-message p, .error-message p {
    color: #fff;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.suggestions {
    margin-top: 25px;
    text-align: left;
    background: rgba(20, 20, 40, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.suggestions p {
    color: #ffa500;
    font-weight: bold;
    margin-bottom: 10px;
}

.suggestions ul {
    color: #ccc;
    padding-left: 20px;
}

.suggestions li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.loading {
    text-align: center;
    color: #ffa500;
    padding: 50px 20px;
    font-size: 20px;
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    margin: 20px auto;
    max-width: 600px;
}

.no-ports {
    text-align: center;
    padding: 20px;
    color: #ccc;
    font-style: italic;
    grid-column: 1 / -1;
}


/* Дополнительные стили для правильного отображения */
.port-details-container {
    margin-top: 25px;
    background: rgba(10, 10, 30, 0.9);
    border: 1px solid #ffa500;
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(15px);
}

.port-details-container h3 {
    color: #ffa500;
    margin-bottom: 20px;
    font-size: 20px;
}

.port-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Убедимся, что контейнеры видны */
.results-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-top: 20px;
    opacity: 1;
    visibility: visible;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.5s ease-out;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .results-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ports-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .search-container.compact {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .search-container {
        width: 95%;
        margin: 30px auto 20px auto;
    }
    
    .search-container.compact {
        width: 95%;
        top: 10px;
    }
    
    .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .select-container, .input-container {
        width: 100%;
        margin-right: 0;
    }
    
    .dropdown {
        width: 100%;
    }
    
    .go-button {
        margin-left: 0;
        width: 100%;
    }
    
    .ports-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .results-container {
        margin-top: 160px;
        padding: 0 10px 10px 10px;
    }
    
    .search-container.compact ~ .results-container {
        margin-top: 100px;
    }
    
    .port-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .ports-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .results-container {
        margin-top: 140px;
    }
    
    .search-container.compact ~ .results-container {
        margin-top: 90px;
    }
}

/* Убедимся, что элементы не скрыты */
.main-info, .ports-section, .ports-container, .port-details-container {
    opacity: 1;
    visibility: visible;
}
