* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --tab-bar-height: 40px;
    --topbar-height: 50px;
    --bg-primary: #000000;
    --bg-secondary: #0a0014;
    --bg-tertiary: #1a0a2e;
    --bg-card: rgba(26, 10, 46, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #ff66ff;
    --accent: #dd00ff;
    --accent-hover: #ff33ff;
    --accent-bright: #ff66ff;
    --border: rgba(255, 102, 255, 0.2);
    --border-hover: rgba(255, 102, 255, 0.5);
    --modal-overlay: rgba(10, 0, 20, 0.95);  
    --shadow-heavy: rgba(221, 0, 255, 0.5);
    --shadow-glow: rgba(255, 102, 255, 0.4);
}

body {
    font-family: 'Poppins', sans-serif;
    background: #000000;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    margin: 0;
    display: flex;
    position: relative;
}

.custom-background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background: #000000; 
    background-image: url('/images/back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.custom-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
}

.main-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}


.tab-bar {
    height: var(--tab-bar-height);
    background: linear-gradient(180deg, rgba(20, 0, 30, 0.98) 0%, rgba(30, 0, 40, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 102, 255, 0.15);
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
    flex-shrink: 0;
    overflow: hidden;
    backdrop-filter: blur(30px);
    box-shadow: 0 2px 20px rgba(221, 0, 255, 0.1);
}

.tabs-container {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    min-width: 180px;
    max-width: 240px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.tab:hover {
    background: rgba(255, 102, 255, 0.08);
}

.tab.active {
    background: linear-gradient(180deg, rgba(221, 0, 255, 0.2) 0%, rgba(255, 102, 255, 0.15) 100%);
    border-bottom: 2px solid #ff66ff;
    box-shadow: 0 0 25px rgba(255, 102, 255, 0.3);
}

.tab-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 3px;
    object-fit: contain;
}

.tab-favicon[src="/images/sat4.png"],
.tab-favicon[src="/images/sat.png"] {
    filter: none;
}

.tab-title {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    text-align: left;
}

.tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: rgba(255, 102, 255, 0.2);
}

.tab-close svg {
    width: 12px;
    height: 12px;
    fill: var(--text-secondary);
}

.tab-add-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tab-add-btn:hover {
    background: rgba(255, 102, 255, 0.12);
    border-color: rgba(255, 102, 255, 0.4);
    color: #ff66ff;
}

.tab-add-btn svg {
    width: 18px;
    height: 18px;
}


.top-bar {
    height: var(--topbar-height);
    background: linear-gradient(180deg, rgba(20, 0, 30, 0.98) 0%, rgba(30, 0, 40, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 102, 255, 0.15);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    flex-shrink: 0;
    backdrop-filter: blur(30px);
    box-shadow: 0 2px 20px rgba(221, 0, 255, 0.1);
}

.nav-controls,
.right-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 102, 255, 0.15);
    border-color: rgba(255, 102, 255, 0.4);
    color: #ff66ff;
    box-shadow: 0 0 20px rgba(255, 102, 255, 0.25);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn img.nav-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.7);
    transition: all 0.2s ease;
}

.nav-btn:hover img.nav-icon {
    opacity: 1;
    filter: brightness(1.2) saturate(1.5);
}

.url-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 8px;
    height: 36px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.url-bar-wrapper:focus-within {
    background: rgba(26, 10, 46, 0.8);
    border-color: #dd00ff;
    box-shadow: 0 0 25px rgba(221, 0, 255, 0.4);
}

.url-bar {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    padding: 0 8px;
}

.url-bar::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}


.home-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.home-content {
    width: 100%;
    max-width: 600px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-title {
    font-size: 100px;
    font-weight: 700;
    background: linear-gradient(135deg, #dd00ff 0%, #ff33ff 50%, #ff66ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
    text-align: center;
    filter: drop-shadow(0 0 40px rgba(221, 0, 255, 0.6));
}

.search-form {
    width: 100%;
    position: relative;
    margin-bottom: 40px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    stroke: var(--text-secondary);
    z-index: 1;
}

#uv-address {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(26, 10, 46, 0.6);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#uv-address:focus {
    border-color: #dd00ff;
    background: rgba(26, 10, 46, 0.8);
    box-shadow: 0 0 35px rgba(221, 0, 255, 0.5);
}

#uv-address::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Shortcuts */
.shortcuts-container {
    width: 100%;
}

.shortcuts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.add-shortcut-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.add-shortcut-btn:hover {
    border-color: #dd00ff;
    background: rgba(221, 0, 255, 0.12);
    color: #ff66ff;
    box-shadow: 0 0 25px rgba(255, 102, 255, 0.35);
}

.add-shortcut-btn img.nav-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.6);
    transition: all 0.2s ease;
}

.add-shortcut-btn:hover img.nav-icon {
    filter: brightness(1.2) saturate(1.5);
    opacity: 1;
}

/* iFrame Wrapper */
.iframe-wrapper {
    flex: 1;
    position: relative;
    display: none;
}

.iframe-wrapper.active {
    display: block;
}

.iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.iframe-container.active {
    display: block;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading Animation */
.proxy-loading-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.loading-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #dd00ff, #ff33ff, #ff66ff);
    animation: loading 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 102, 255, 0.5);
}

.loading-bar.indeterminate {
    width: 30%;
    animation: loadingSlide 1.5s ease-in-out infinite;
}

@keyframes loading {
    0%   { width: 0%;  margin-left: 0%; }
    50%  { width: 50%; margin-left: 25%; }
    100% { width: 0%;  margin-left: 100%; }
}

@keyframes loadingSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 10, 46, 0.3);
    border-top-color: #ff66ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 25px rgba(255, 102, 255, 0.5);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Quick Popup */
.quick-popup {
    position: fixed;
    background: rgba(10, 0, 20, 0.95);
    border: 1px solid rgba(255, 102, 255, 0.3);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 8px 40px rgba(221, 0, 255, 0.6);
    backdrop-filter: blur(30px);
}

.popup-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ff66ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-option {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--text-primary);
}

.popup-option:hover {
    background: rgba(255, 102, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 102, 255, 0.25);
}

.popup-option.active {
    background: rgba(221, 0, 255, 0.25);
    color: #ff66ff;
}

.popup-option img.nav-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.7);
    transition: all 0.2s ease;
}

.popup-option:hover img.nav-icon {
    opacity: 1;
    filter: brightness(1.2) saturate(1.5);
}

.popup-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.popup-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.popup-section-title {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, rgba(10, 0, 20, 0.98) 0%, rgba(26, 10, 46, 0.95) 100%);
    border: 1px solid rgba(255, 102, 255, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(221, 0, 255, 0.7);
    backdrop-filter: blur(30px);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #dd00ff, #ff66ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 102, 255, 0.15);
    border-color: rgba(255, 102, 255, 0.4);
}

.modal-close img.nav-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.6);
    transition: all 0.2s ease;
}

.modal-close:hover img.nav-icon {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.input-group input:focus {
    border-color: #dd00ff;
    background: rgba(26, 10, 46, 0.8);
    box-shadow: 0 0 20px rgba(221, 0, 255, 0.4);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #dd00ff, #ff33ff);
    color: white;
    box-shadow: 0 4px 20px rgba(221, 0, 255, 0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff33ff, #ff66ff);
    box-shadow: 0 6px 30px rgba(255, 102, 255, 0.6);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 102, 255, 0.15);
    border-color: rgba(255, 102, 255, 0.4);
}