/**
 * Zarza Network Tools - Simplified CSS
 * Modern design for network tools interface
 */

/* Main Tool Container */
.zarza-tool {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
}

.zarza-tool:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Tool Header */
.zarza-tool-header h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: inline-block;
}

/* Input Section */
.zarza-tool-input {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.zarza-input,
.zarza-dns-type {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.zarza-input:focus,
.zarza-dns-type:focus {
    outline: none;
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.zarza-dns-type {
    flex: 0 0 140px;
    min-width: 140px;
}

.zarza-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.zarza-button:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.zarza-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Input validation */
.zarza-input-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.zarza-input-valid {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
}

/* Results Section */
.zarza-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* Loading State */
.zarza-loading {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.zarza-status-text {
    margin-top: 16px;
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    white-space: pre-line;
}

.zarza-loading .zarza-status-text {
    animation: zarza-pulse 2s ease-in-out infinite;
}

@keyframes zarza-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Spinner */
.zarza-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: zarza-spin 1s linear infinite;
    margin: 0 auto;
}

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

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



/* Rate Limit Warning */
.zarza-rate-limit-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

/* Podium Section */
.zarza-podium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.zarza-podium h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

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

.zarza-podium-item:last-child {
    border-bottom: none;
}

.zarza-medal {
    font-size: 20px;
    margin-right: 10px;
}

.zarza-node-name {
    flex: 1;
    font-weight: 500;
}

.zarza-time {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

/* Detailed Results */
.zarza-detailed-results {
    margin-top: 24px;
}

.zarza-detailed-results h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

/* Node Results */
.zarza-node-result {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.zarza-node-header {
    background: #34495e;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zarza-node-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.zarza-node-error {
    padding: 20px;
    color: #e74c3c;
    font-weight: 500;
    background: #fdf2f2;
}

/* Ping Results */
.zarza-ping-result {
    padding: 20px;
}

.zarza-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.zarza-stat-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.zarza-stat-item label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.zarza-ping-avg,
.zarza-ping-min,
.zarza-ping-max,
.zarza-ping-loss {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.zarza-ping-avg {
    color: #3498db;
}

.zarza-ping-min {
    color: #27ae60;
}

.zarza-ping-max {
    color: #e67e22;
}

.zarza-ping-loss {
    color: #e74c3c;
}

.zarza-ping-details h6 {
    margin: 20px 0 12px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.zarza-ping-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zarza-ping-item {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.zarza-excellent {
    background: #d5f4e6;
    color: #27ae60;
}

.zarza-good {
    background: #fff3cd;
    color: #856404;
}

.zarza-fair {
    background: #f8d7da;
    color: #721c24;
}

.zarza-poor {
    background: #f5c6cb;
    color: #721c24;
}

/* Traceroute Results */
.zarza-traceroute-result {
    padding: 20px;
}

.zarza-traceroute-hops h6 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.zarza-hop {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    gap: 16px;
}

.zarza-hop:last-child {
    border-bottom: none;
}

.zarza-hop-num {
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.zarza-hop-ip {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-width: 120px;
    color: #2c3e50;
}

.zarza-hop-times {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.zarza-hop-time {
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #7f8c8d;
}

/* DNS Results */
.zarza-dns-result {
    padding: 20px;
}

.zarza-dns-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.zarza-dns-records h6 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.zarza-dns-record {
    background: #e8f5e8;
    color: #27ae60;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border-left: 4px solid #27ae60;
    word-break: break-all;
}

/* Port Results */
.zarza-port-result {
    padding: 20px;
}

.zarza-port-target {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.zarza-port-list h6 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.zarza-port-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}

.zarza-port-open {
    background: #d5f4e6;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.zarza-port-closed {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

.zarza-port-num {
    font-weight: 600;
    min-width: 60px;
}

.zarza-port-status {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

/* MTR Results */
.zarza-mtr-result {
    padding: 20px;
}

.zarza-mtr-raw {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
}

.zarza-mtr-raw pre {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    margin: 0;
}

.zarza-mtr-raw h6 {
    margin: 0 0 10px 0;
    color: #ecf0f1;
}

/* Error States */
.zarza-error {
    background: #fdf2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 20px;
    border-radius: 8px;
}

.zarza-error h4 {
    margin: 0 0 8px 0;
    color: #dc2626;
}

.zarza-error-hint {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.zarza-error-details {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

.zarza-error-details h5 {
    margin: 0 0 10px 0;
    color: #dc3545;
    font-size: 16px;
}

.zarza-error-details ul {
    margin: 10px 0;
    padding-left: 25px;
}

.zarza-error-details li {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .zarza-tool {
        padding: 16px;
        margin: 16px 0;
    }

    .zarza-tool-input {
        flex-direction: column;
        align-items: stretch;
    }

    .zarza-input,
    .zarza-dns-type {
        min-width: auto;
        width: 100%;
    }

    .zarza-stats {
        flex-direction: column;
        gap: 8px;
    }

    .zarza-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .zarza-ping-sequence {
        display: grid;
        grid-template-columns: 1fr;
    }

    .zarza-podium-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .zarza-hop {
        flex-wrap: wrap;
        gap: 8px;
    }

    .zarza-node-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .zarza-tool-header h3 {
        font-size: 20px;
    }

    .zarza-stat-grid {
        grid-template-columns: 1fr;
    }

    .zarza-hop-ip {
        min-width: auto;
        word-break: break-all;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .zarza-tool {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }

    .zarza-tool-header h3 {
        color: #ecf0f1;
    }

    .zarza-input,
    .zarza-dns-type {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }

    .zarza-results {
        background: #34495e;
    }

    .zarza-node-result {
        background: #34495e;
        border-color: #4a5f7a;
    }

    .zarza-stat-item {
        background: #4a5f7a;
        color: #ecf0f1;
    }

    .zarza-dns-info,
    .zarza-port-target {
        background: #4a5f7a;
        color: #ecf0f1;
    }
}

/* Print Styles */
@media print {
    .zarza-tool-input {
        display: none;
    }

    .zarza-tool {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .zarza-summary,
    .zarza-podium {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
}

/* Animated Podium Section */
.zarza-podium-animated {
    display: none;
    /* Initially hidden, shown with animation */
    align-items: flex-end;
    justify-content: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.zarza-podium__item {
    width: 33.33%;
    max-width: 200px;
    text-align: center;
    padding: 0 10px;
}

.zarza-podium__city {
    text-align: center;
    padding: 0 0.5rem;
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 40px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zarza-podium__rank {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    min-height: 50px;
}

/* First Place - Gold */
.zarza-podium .first {
    height: 0;
    /* Start at 0 for animation */
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 -4px 12px rgba(255, 215, 0, 0.4);
    position: relative;
}

.zarza-podium .first::before {
    content: "🥇";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
}

/* Second Place - Silver */
.zarza-podium .second {
    height: 0;
    /* Start at 0 for animation */
    background: linear-gradient(135deg, #C0C0C0, #808080);
    box-shadow: 0 -4px 12px rgba(192, 192, 192, 0.4);
    position: relative;
}

.zarza-podium .second::before {
    content: "🥈";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
}

/* Third Place - Bronze */
.zarza-podium .third {
    height: 0;
    /* Start at 0 for animation */
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    box-shadow: 0 -4px 12px rgba(205, 127, 50, 0.4);
    position: relative;
}

.zarza-podium .third::before {
    content: "🥉";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .zarza-podium-animated {
        padding: 15px 5px;
    }

    .zarza-podium__item {
        padding: 0 5px;
    }

    .zarza-podium__city {
        font-size: 12px;
    }

    .zarza-podium__rank {
        font-size: 14px;
    }
}
























/* Ping Results Table Styles */
.zarza-ping-table {
    margin: 20px 0;
    overflow-x: auto;
}

.zarza-results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.zarza-results-table thead {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.zarza-results-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    background: #494949 !important;
}

.zarza-results-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.zarza-results-table tbody tr:hover {
    background: #f8f9fa;
}

.zarza-results-table tbody tr:last-child {
    border-bottom: none;
}

.zarza-results-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Node cell styles */
.node-cell {
    font-weight: 500;
}

.node-location {
    color: #2c3e50;
    font-size: 14px;
}

.country-flag {
    width: 20px;
    height: 14px;
    margin-top: 4px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

/* Host info */
.host-info {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #555;
}

/* Status dots */
.status-cell {
    text-align: center;
}

.status-dot {
    font-size: 18px;
    margin: 0 2px;
}

.status-dot.status-success {
    color: #27ae60;
}

.status-dot.status-fail {
    color: #e74c3c;
}

/* Time badges with color coding */
.time-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 13px;
}

.time-badge.speed-excellent {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.time-badge.speed-good {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.time-badge.speed-fair {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.time-badge.speed-poor {
    background: #f5c6cb;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* Detailed ping sequence (collapsible) */
.zarza-ping-details {
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.zarza-ping-details summary {
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.zarza-ping-details summary:hover {
    background: #e9ecef;
}

.zarza-ping-details .zarza-ping-sequence {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zarza-ping-details .zarza-ping-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid transparent;
}

.zarza-ping-details .zarza-ping-item small {
    opacity: 0.7;
    margin-right: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .zarza-results-table {
        font-size: 12px;
    }

    .zarza-results-table th,
    .zarza-results-table td {
        padding: 8px 10px;
    }

    .time-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .status-dot {
        font-size: 14px;
        margin: 0 1px;
    }
}

@media (max-width: 480px) {
    .zarza-ping-table {
        overflow-x: scroll;
    }

    .zarza-results-table {
        min-width: 500px;
    }
}

/* Error message in table cells */
.zarza-results-table td.error-message {
    color: #e74c3c;
    font-style: italic;
    text-align: center;
    background: #fdf2f2;
}

/* Status fail indicator */
.status-dot.status-fail {
    color: #e74c3c;
}

/* Hover effect for table rows */
.zarza-results-table tbody tr:hover {
    background: #f0f8ff;
    transform: translateX(2px);
    transition: all 0.2s ease;
}

/* Better spacing for node cells */
.zarza-results-table .node-cell {
    min-width: 120px;
}

/* Ensure table is responsive */
@media (max-width: 768px) {
    .zarza-ping-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .zarza-results-table {
        min-width: 600px;
    }
}