/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --tw-bg-opacity: 1;
    --bg-primary: rgb(249 250 251 / var(--tw-bg-opacity, 1));
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --accent-cyan: #000000;
    --accent-cyan-light: #000000;
    --accent-green: #000000;
    --accent-red: #000000;
    --accent-blue: #000000;
    --text-primary: #000000;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-glow: rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-glow-green: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-glow-red: 0 1px 3px rgba(0, 0, 0, 0.1);
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
}

body {
    font-family: var(--font-primary);
    background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
    --tw-bg-opacity: 1;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.logo {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.logo a:hover,
.logo a:visited,
.logo a:active {
    color: inherit;
    text-decoration: none;
}

.logo .accent {
    color: var(--text-primary);
}

.tagline {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 300;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
}

.search-container {
    max-width: 1000px;
    margin: 0 auto;
}

.search-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row:last-child {
    margin-bottom: 0;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    height: 48px;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

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


.btn-search {
    padding: 12px 32px;
    background: var(--text-primary);
    border: 1px solid var(--text-primary);
    border-radius: 8px;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
    min-width: 120px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(10, 10, 10, 0.3);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Controls Section */
.controls-section {
    margin-bottom: 30px;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.filter-tab:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 600;
}

.filter-dropdown {
    display: inline-block;
}

.filter-select {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    height: 36px;
    box-sizing: border-box;
}

.filter-select:hover {
    border-color: var(--text-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.view-controls {
    display: flex;
    gap: 10px;
}

.view-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.view-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.view-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.results-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.stat-item.success {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.stat-item.error {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.results-view {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table thead {
    background: var(--bg-primary);
}

.results-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

.status-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.status-icon.success {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    box-shadow: none;
}

.status-icon.error {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    box-shadow: none;
}

.status-icon.pending {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.server-name {
    font-weight: 500;
    color: var(--text-primary);
}

.server-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.location-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    display: inline-block;
}

.server-ip {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 13px;
}

.response-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 13px;
    word-break: break-all;
    max-width: 300px;
}

.response-item {
    margin-bottom: 4px;
    line-height: 1.4;
}

.response-item:last-child {
    margin-bottom: 0;
}

.response-time {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 12px;
}

/* Map View */
.map-container {
    min-height: 500px;
    position: relative;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
}

.world-map {
    width: 100%;
    height: 100%;
}

.map-land {
    fill: var(--bg-primary);
    stroke: var(--border-color);
    stroke-width: 1;
    transition: all 0.3s ease;
}

.map-land:hover {
    fill: rgba(0, 0, 0, 0.05);
}

.map-pins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-pin {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    transform: translate(-50%, -50%);
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-pin.success {
    background: var(--text-primary);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.map-pin.error {
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
}

.map-pin.pending {
    background: var(--text-muted);
}

.map-pin:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 250, 251, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.loading-progress {
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font-mono);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
}

.modal-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-cancel,
.btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-submit {
    background: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .logo {
        font-size: 32px;
    }

    .search-form {
        padding: 20px;
    }

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

    .expected-input-wrapper {
        flex-direction: column;
    }

    .match-type-select {
        width: 100%;
    }

    .btn-search {
        width: 100%;
    }

    .controls-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-stats {
        width: 100%;
    }

    .stat-item {
        flex: 1;
        justify-content: center;
    }

    .results-table {
        font-size: 12px;
    }

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

    .response-value {
        max-width: 150px;
    }

    .modal-content {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 24px;
    }

    .tagline {
        font-size: 14px;
    }

    .search-form {
        padding: 15px;
    }

    .results-table {
        font-size: 11px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

