* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.container {
    position: relative;
    z-index: 1;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    max-width: 700px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.logo {
    text-align: center;
    margin-bottom: 8px;
}

.logo h1 {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.tab.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* VPN Server List */
.server-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.server-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(56, 189, 248, 0.15);
}

.server-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.flag {
    font-size: 28px;
}

.server-details h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.server-details p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.server-details .details {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    margin-top: 4px;
}

.test-btn {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
}

.test-btn:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

.test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.test-btn.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.test-btn.success:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.test-btn.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.test-btn.error:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.test-btn.blocked {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.test-btn.blocked:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.test-btn.testing {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

/* Hover effect for buttons with results - show default style */
.test-btn[data-has-result="true"]:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
}

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

.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.test-all-btn {
    width: 100%;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.test-all-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.test-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* DPI Table */
.dpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dpi-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.dpi-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    margin-top: 4px;
}

.dpi-start-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dpi-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.dpi-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0891b2 0%, #0e7490 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.dpi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dpi-table th,
.dpi-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dpi-table th {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dpi-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dpi-table .test-id {
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.dpi-table .provider-flag {
    font-size: 16px;
}

.dpi-table .provider-name {
    color: rgba(255, 255, 255, 0.8);
}

.dpi-status {
    font-weight: 600;
    font-size: 13px;
}

.dpi-status.pending {
    color: rgba(255, 255, 255, 0.3);
}

.dpi-status.checking {
    color: #fbbf24;
}

.dpi-status.detected {
    color: #ef4444;
}

.dpi-status.detected-star {
    color: #ef4444;
}

.dpi-status.ok {
    color: #22c55e;
}

.dpi-status.warning {
    color: #f59e0b;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dpi-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

/* Debug panel */
.debug-toggle {
    text-align: center;
    margin-top: 20px;
}

.debug-toggle label {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    cursor: pointer;
    user-select: none;
}

.debug-panel {
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    max-height: 200px;
    overflow-y: auto;
}

.debug-panel.show {
    display: block;
}

.debug-entry {
    margin-bottom: 4px;
}

.debug-entry.success {
    color: #22c55e;
}

.debug-entry.error {
    color: #ef4444;
}

.debug-entry.info {
    color: #60a5fa;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablets and smaller screens */
@media (max-width: 768px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .container {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .tabs {
        margin-bottom: 20px;
        padding: 5px;
    }

    .tab {
        padding: 10px 8px;
        font-size: 13px;
    }

    .server-card {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .server-info {
        width: 100%;
        gap: 12px;
    }

    .flag {
        font-size: 24px;
        flex-shrink: 0;
    }

    .server-details {
        flex: 1;
        min-width: 0;
    }

    .server-details h3 {
        font-size: 15px;
    }

    .server-details p {
        font-size: 12px;
    }

    .server-details .details {
        font-size: 10px;
    }

    .test-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        text-align: center;
    }

    .test-all-btn {
        padding: 14px;
        font-size: 15px;
        margin-bottom: 20px;
    }

    .dpi-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dpi-header h2 {
        font-size: 16px;
    }

    .dpi-header p {
        font-size: 12px;
    }

    .dpi-start-btn {
        width: 100%;
        padding: 12px;
        text-align: center;
    }

    .dpi-table-wrapper {
        max-height: 350px;
    }

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

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

    .dpi-table .test-id {
        font-size: 10px;
    }

    .dpi-status {
        font-size: 11px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .tabs {
        gap: 6px;
        padding: 4px;
        margin-bottom: 16px;
    }

    .tab {
        padding: 10px 6px;
        font-size: 12px;
        border-radius: 6px;
    }

    .server-card {
        padding: 14px;
        border-radius: 12px;
        gap: 10px;
    }

    .server-info {
        gap: 10px;
    }

    .flag {
        font-size: 22px;
    }

    .server-details h3 {
        font-size: 14px;
    }

    .server-details p {
        font-size: 11px;
        word-break: break-all;
    }

    .server-details .details {
        font-size: 9px;
        word-break: break-all;
    }

    .test-btn {
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    .test-all-btn {
        padding: 12px;
        font-size: 14px;
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .loading {
        width: 12px;
        height: 12px;
    }

    .dpi-header h2 {
        font-size: 15px;
    }

    .dpi-header p {
        font-size: 11px;
    }

    .progress-bar {
        margin-bottom: 16px;
    }

    .dpi-table-wrapper {
        max-height: 300px;
    }

    .dpi-table {
        font-size: 10px;
    }

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

    .dpi-table th {
        font-size: 9px;
        letter-spacing: 0.3px;
    }

    .dpi-table .test-id {
        font-size: 9px;
    }

    .dpi-table .provider-flag {
        font-size: 14px;
    }

    .dpi-status {
        font-size: 10px;
        line-height: 1.3;
    }

    .debug-panel {
        padding: 12px;
        font-size: 10px;
        max-height: 150px;
    }

    .debug-toggle label {
        font-size: 10px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 16px 12px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .tab {
        font-size: 11px;
        padding: 8px 4px;
    }

    .server-card {
        padding: 12px;
    }

    .flag {
        font-size: 20px;
    }

    .test-btn {
        font-size: 12px;
        padding: 8px;
    }
}
