/* Browser Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html,
#app {
    font-family: 'Inter', system-ui, sans-serif;
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: var(--background);
    overflow: hidden;
    color: var(--text);
}

/* Layout */
.browser-container {
        position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg);
}

.top-bar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
}

.top-bar button:hover {
    background: var(--surface-hover);
    color: var(--text);
}

input.bar {
    flex: 1;
    height: 36px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.15s;
}

input.bar:focus {
    border-color: var(--border-light);
    background: var(--surface-hover);
}

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

/* Iframe */
.iframe-container {
        width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    position: fixed;
    bottom: 0px;
    right: 0px;
    width: calc(100%);
    height: calc(100% - (130px * 0.7));
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-image: initial;
    outline: none;
    z-index: 3;
    display: block;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    position: fixed;
    bottom: 0px;
    right: 0px;
    width: calc(100% - (16px * 0.7));
    height: calc(100% - (138px * 0.7));
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-image: initial;
    z-index: 3;
    display: block;
    margin: calc(8px * 0.7);
    box-shadow: 0 0px 20px 0 var(--shadow);
    outline: var(--border-thickness) solid var(--border);
    border-radius: calc(24px * 0.7);
}

.browser-frame {
    transition: filter 0.3s ease;
}

.message-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: var(--text);
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 0px 20px 0 var(--shadow);
    outline: var(--border-thickness) solid var(--border);
    border-radius: 24px;
}

.message-content {
    max-width: 400px;
    padding: 20px;
}

.message-content h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.message-content p {
    color: var(--text-muted);
    font-size: 13px;
    word-break: break-all;
}

.spinner {
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

#skip-btn {
    margin-top: 20px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    display: none;
}

#skip-btn:hover {
    border-color: var(--border-light);
    color: var(--text);
}



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

/* Loading Bar */
.loading-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9998;
    pointer-events: none;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--color1));
    width: 0%;
    opacity: 1;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

/* Settings Modal */
.wisp-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wisp-settings-modal.hidden {
    display: none;
}

.settings-card {
    background: var(--surface);
    width: 400px;
    max-width: 90vw;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.settings-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
}

.close-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.settings-content {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    margin-top: 8px;
}

.wisp-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.wisp-option:hover {
    border-color: var(--border-light);
}

.wisp-option.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.wisp-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wisp-option-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
}

.wisp-option-url {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ping-text {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.status-success {
    background: #22c55e;
}

.status-indicator.status-error {
    background: #ef4444;
}

.custom-input-group {
    display: flex;
    gap: 8px;
}

.custom-input-group input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Consolas', monospace;
    font-size: 12px;
    outline: none;
    transition: all 0.15s;
}

.custom-input-group input:focus {
    border-color: var(--accent);
}

.custom-input-group button {
    height: 36px;
    padding: 0 14px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.custom-input-group button:hover {
    opacity: 0.9;
}

.settings-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.delete-wisp-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: 6px;
    transition: color 0.15s;
}

.delete-wisp-btn:hover {
    color: #ef4444;
}

/* Toggle Switch */
.toggle-switch {
    width: 40px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: var(--accent);
}

.toggle-knob {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

.flex {
    display: flex;
}