
html{
    display: flex;
    justify-content: space-evenly;
}
:root {
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --background-color: var(--background);
    --text-color: var(--text);
    --card-bg: var(--card_bg);
    --card-border: var(--card_border);
    --input-bg: var(--input_bg);
    --hover-bg: var(--hover_bg);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(333deg, var(--background) 0%, #1a1a2e 100%);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header Styles */
header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo-banner {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.logo {
    max-width: 150px;
    height: auto;
    transition: var(--transition);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo:hover {
    transform: translateY(-2px);
}

.title-wrapper {
    text-align: center;
}

.title {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.title h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(333deg, #fff -20%, #a0a0a0 100%);
    -webkit-background-clip: text;
    /* -webkit-text-fill-color: transparent; */
    background-clip: text;
}

.gradient-text {
    background: linear-gradient(333deg, var(--primary-color) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.gittag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.tag-label {
    color: var(--text);
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Speedometer Section */
.speedometer-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.speedometer-container {
    position: relative;
    display: flex;
    /* justify-content: center; */
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    flex-direction: row;
}

.speedometer {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
}

.number {
    text-align: center;
    padding-top: 40px;
}

.number div {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(333deg, #fff -20%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.units {
    font-size: 1rem;
    color: var(--text);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Bidir Display (FAST.com style) */
.bidir-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.bidir-status {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bidir-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.bidir-direction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bidir-direction-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bidir-icon {
    width: 22px;
    height: 22px;
    opacity: 0.7;
}

.bidir-icon-download {
    color: #3b82f6;
}

.bidir-icon-upload {
    color: #8b5cf6;
}

.bidir-speed {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.bidir-speed-value {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(333deg, #fff -20%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.bidir-speed-unit {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0.7;
}

.bidir-divider {
    width: 60%;
    height: 1px;
    background: var(--card-border);
    margin: 0.25rem 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Input Groups */
.input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-small {
    min-width: 120px;
}

.field {
    margin-bottom: 1.5rem;
}

.field:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Toggle Buttons */
.toggle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.toggle-container.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.toggle-btn {
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.toggle-btn.active {
    background: linear-gradient(333deg, var(--primary-color) -20%, #8b5cf6 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.toggle-icon {
    width: 18px;
    height: 18px;
}

.toggle-label {
    font-size: 0.95rem;
}

/* Buttons */
.server-select-btn,
.run-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.server-select-btn {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text);
}

.server-select-btn:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.run-btn {
    background: linear-gradient(333deg, var(--primary-color) 20%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    font-size: 1.1rem;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.run-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Output Card */
.output-card {
    grid-column: 1 / -1;
}

#output h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

#output pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Popup */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 999;
}

#popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    background: var(--background);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.popup-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

#searchInput {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-y: auto;
    max-height: calc(80vh - 200px);
    border-radius: var(--border-radius-sm);
}

#csvTable {
    width: 100%;
    border-collapse: collapse;
}

#csvTable th,
#csvTable td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

#csvTable th {
    background: var(--card-bg);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#csvTable tr {
    transition: var(--transition);
}

#csvTable tr:hover {
    background: var(--hover-bg);
    cursor: pointer;
}

/* Selected Server */
#selectedServer {
    margin-top: 1rem;
}

.bubble-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bubble {
    background: linear-gradient(333deg, var(--primary-color) -20%, #8b5cf6 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Footer */
footer {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--card-border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text)
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: #8b5cf6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .output-card {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .title h1 {
        font-size: 1.5rem;
        color: var(--text);
        textcolor
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .input-small {
        min-width: auto;
    }
    
    .speedometer-container {
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    #popup {
        width: 95%;
        padding: 1.5rem;
    }
    
    .toggle-container.three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .title {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .gittag {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-banner {
        gap: 1rem;
    }
    
    .logo {
        max-width: 100px;
    }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card {
    animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}