/* Ring Menu Styles */
.server-ring-menu {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 600px;
    margin: 60px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

/* ToS Notice */
.tos-notice {
    max-width: 900px;
    margin: -40px auto 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tos-notice i {
    color: rgba(138, 43, 226, 0.6);
    font-size: 12px;
}

.tos-notice p {
    color: rgba(192, 192, 192, 0.7);
    font-size: 11px;
    margin: 0;
}

.tos-notice a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tos-notice a:hover {
    color: #c084fc;
    text-decoration: underline;
}

.ring-center {
    position: absolute;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.4) 0%, rgba(14, 6, 32, 0.6) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 
        0 20px 60px rgba(138, 43, 226, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: centerPulse 3s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ring-center::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes centerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.center-logo {
    text-align: center;
    color: white;
}

.center-logo i {
    font-size: 48px;
    margin-bottom: 10px;
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.center-logo h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 5px 0;
    letter-spacing: 1px;
}

.center-logo p {
    font-size: 12px;
    opacity: 0.9;
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.ring-items {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ring-items::before {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border: 2px dashed rgba(138, 43, 226, 0.3);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: rotateDashedRing 40s linear infinite;
}

@keyframes rotateDashedRing {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Container für Verbindungslinien */
.connections-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

/* Verbindungslinien vom Center zu den Items */
.ring-connection {
    position: absolute;
    width: 250px;
    height: 2px;
    background: linear-gradient(to right, 
        rgba(147, 51, 234, 1) 0%,
        rgba(147, 51, 234, 0.6) 30%,
        rgba(147, 51, 234, 0.3) 70%,
        rgba(147, 51, 234, 0.1) 100%);
    left: 50%;
    top: 50%;
    transform-origin: left center;
    transform: translateY(-50%);
    opacity: 1;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
}

.ring-connection::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(138, 43, 226, 0.8) 0%,
        transparent 50%);
    opacity: 0;
    animation: flowToCenter 3s ease-in-out infinite;
}

@keyframes flowToCenter {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ring-item {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    will-change: transform;
    overflow: visible;
}

.ring-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}


@keyframes counterRotate {
    from { transform: rotate(0deg) translateZ(0); }
    to { transform: rotate(-360deg) translateZ(0); }
}

.ring-item:hover {
    transform: scale(1.15) translateZ(50px);
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 20px 50px rgba(138, 43, 226, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.ring-item:hover::before {
    opacity: 1;
}

.ring-item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.ring-item.clicked {
    animation: clickBounce 0.4s ease-out;
}

@keyframes clickBounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.2);
    }
    60% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.ring-item.active {
    animation: activeGlow 2s ease-in-out infinite;
    z-index: 101;
}

@keyframes activeGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(138, 43, 226, 0.6),
                    0 0 60px rgba(138, 43, 226, 0.4),
                    0 0 90px rgba(138, 43, 226, 0.2);
        transform: scale(1.1);
        border-color: rgba(138, 43, 226, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(138, 43, 226, 0.8),
                    0 0 80px rgba(138, 43, 226, 0.6),
                    0 0 120px rgba(138, 43, 226, 0.4);
        transform: scale(1.15);
        border-color: rgba(138, 43, 226, 1);
    }
}

/* Position items in a circle - 7 items */
.ring-item {
    left: 50%;
    top: 50%;
}

.ring-item:nth-child(1) { 
    transform: translate(-50%, -50%) rotate(0deg) translateX(250px) rotate(0deg);
}

.ring-item:nth-child(2) { 
    transform: translate(-50%, -50%) rotate(51.43deg) translateX(250px) rotate(-51.43deg);
}

.ring-item:nth-child(3) { 
    transform: translate(-50%, -50%) rotate(102.86deg) translateX(250px) rotate(-102.86deg);
}

.ring-item:nth-child(4) { 
    transform: translate(-50%, -50%) rotate(154.29deg) translateX(250px) rotate(-154.29deg);
}

.ring-item:nth-child(5) { 
    transform: translate(-50%, -50%) rotate(205.71deg) translateX(250px) rotate(-205.71deg);
}

.ring-item:nth-child(6) { 
    transform: translate(-50%, -50%) rotate(257.14deg) translateX(250px) rotate(-257.14deg);
}

.ring-item:nth-child(7) { 
    transform: translate(-50%, -50%) rotate(308.57deg) translateX(250px) rotate(-308.57deg);
}

/* Item specific colors */
.ring-item.aistudio {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    color: white;
}
.ring-item.aistudio:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4) 0%, rgba(168, 85, 247, 0.4) 100%);
}

.ring-item.openrouter {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(244, 114, 182, 0.2) 100%);
    color: white;
}
.ring-item.openrouter:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(244, 114, 182, 0.4) 100%);
}

.ring-item.anthropic {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(167, 139, 250, 0.2) 100%);
    color: white;
}
.ring-item.anthropic:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(167, 139, 250, 0.4) 100%);
}

.ring-item.chutes {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.2) 100%);
    color: white;
}
.ring-item.chutes:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(129, 140, 248, 0.4) 100%);
}

.ring-item.deepseek {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    color: white;
}
.ring-item.deepseek:hover {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.4) 0%, rgba(124, 58, 237, 0.4) 100%);
}

.ring-item.openai {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(192, 132, 252, 0.2) 100%);
    color: white;
}
.ring-item.openai:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.4) 0%, rgba(192, 132, 252, 0.4) 100%);
}

.ring-item.mistral {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(244, 63, 94, 0.2) 100%);
    color: white;
}
.ring-item.mistral:hover {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.4) 0%, rgba(244, 63, 94, 0.4) 100%);
}

/* NEW Badge für Mistral */
.ring-item.mistral {
    position: relative;
}

.ring-item.mistral .new-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #ff0844 0%, #ffb700 100%);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: starPulse 3s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
    font-size: 4.5px !important;
    color: white !important;
    font-weight: 900 !important;
    font-family: 'Orbitron', 'Arial Black', Arial, sans-serif !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
    letter-spacing: 0.2px !important;
    line-height: 1 !important;
}

/* ::before rule removed - using HTML content directly */

@keyframes starPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1) drop-shadow(0 2px 8px rgba(255, 8, 68, 0.6));
    }
    50% { 
        transform: scale(1.1) rotate(0deg);
        filter: brightness(1.2) drop-shadow(0 2px 12px rgba(255, 8, 68, 0.8));
    }
}

.ring-item i {
    font-size: 32px;
    margin-bottom: 8px;
}

.ring-item span {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Detail Panel */
.proxy-detail-panel {
    position: fixed;
    right: -500px;
    top: 0;
    width: 500px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 15, 35, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        -20px 0 60px rgba(102, 126, 234, 0.3),
        inset 0 0 100px rgba(255, 255, 255, 0.02);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Ensure content is always accessible */
    padding-top: env(safe-area-inset-top);
}

.proxy-detail-panel.active {
    right: 0;
}

.detail-header {
    padding: 40px 30px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.3);
    margin-top: 0;
    text-align: center;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.detail-header h2 {
    margin: 15px 0 12px;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.detail-header p {
    margin-bottom: 8px;
    font-size: 16px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.detail-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 18px !important;
    height: 18px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    color: white !important;
    font-size: 9px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.detail-close:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.1) !important;
}

.detail-content {
    padding: 30px;
    color: #e0e0e0;
}

.setup-section {
    margin-bottom: 15px;
}

.setup-section h4 {
    color: #f0f0f0;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.setup-section h4 i {
    color: #a78bfa;
    font-size: 16px;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    justify-content: center;
}

.model-tag {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.model-tag:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    border-color: transparent;
}

.model-tag.recommended {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    animation: recommendedPulse 2s ease-in-out infinite;
}

@keyframes recommendedPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.6); }
}

.url-box {
    background: rgba(102, 126, 234, 0.05);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(5px);
}

.url-box code {
    display: block;
    font-size: 14px;
    color: #a78bfa;
    white-space: nowrap;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.5) rgba(0, 0, 0, 0.1);
}

.copy-url-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.copy-url-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.copy-url-btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Mobile Responsive */
/* Tablet View */
@media (max-width: 992px) {
    .server-ring-menu {
        height: 550px;
    }
    
    .ring-item {
        width: 90px;
        height: 90px;
    }
    
    .ring-item i {
        font-size: 28px;
    }
    
    .ring-center {
        width: 160px;
        height: 160px;
    }
    
    .center-logo i {
        font-size: 38px;
    }
    
    .center-logo h3 {
        font-size: 16px;
    }
    
    .center-logo p {
        font-size: 11px;
    }
    
    /* Adjust ring radius for tablet */
    .ring-item:nth-child(1) { 
        transform: translate(-50%, -50%) rotate(0deg) translateX(200px) rotate(0deg);
    }
    .ring-item:nth-child(2) { 
        transform: translate(-50%, -50%) rotate(51.43deg) translateX(200px) rotate(-51.43deg);
    }
    .ring-item:nth-child(3) { 
        transform: translate(-50%, -50%) rotate(102.86deg) translateX(200px) rotate(-102.86deg);
    }
    .ring-item:nth-child(4) { 
        transform: translate(-50%, -50%) rotate(154.29deg) translateX(200px) rotate(-154.29deg);
    }
    .ring-item:nth-child(5) { 
        transform: translate(-50%, -50%) rotate(205.71deg) translateX(200px) rotate(-205.71deg);
    }
    .ring-item:nth-child(6) { 
        transform: translate(-50%, -50%) rotate(257.14deg) translateX(200px) rotate(-257.14deg);
    }
    .ring-item:nth-child(7) { 
        transform: translate(-50%, -50%) rotate(308.57deg) translateX(200px) rotate(-308.57deg);
    }
}

/* Mobile View */
@media (max-width: 768px) and (orientation: portrait), (max-width: 896px) and (orientation: landscape) {
    .server-ring-menu {
        height: 500px;
        padding: 1.5rem;
        margin: -2rem auto 2rem !important;
        margin-top: -2rem !important;
        max-width: 100%;
    }
    
    .ring-item {
        width: 85px;
        height: 85px;
        backdrop-filter: blur(15px);
        -webkit-tap-highlight-color: transparent;
        border: 2px solid rgba(255, 255, 255, 0.25);
        box-shadow: 
            0 8px 25px rgba(31, 38, 135, 0.4),
            inset 0 0 25px rgba(255, 255, 255, 0.08);
    }
    
    /* Remove hover effects on touch devices */
    .ring-item:hover {
        transform: none;
        background: inherit;
        border-color: inherit;
        box-shadow: inherit;
    }
    
    /* Disable active animation on mobile - keep items in place */
    .ring-item.active {
        animation: none !important;
        transform: none !important;
        box-shadow: 
            0 8px 25px rgba(138, 43, 226, 0.5),
            inset 0 0 25px rgba(255, 255, 255, 0.1) !important;
        border: 2px solid rgba(138, 43, 226, 0.8) !important;
        background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(167, 139, 250, 0.3) 100%) !important;
    }
    
    /* Enhanced active state for better touch feedback */
    .ring-item:active {
        transform: scale(0.95);
        opacity: 0.9;
        box-shadow: 
            0 4px 15px rgba(31, 38, 135, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.12);
    }
    
    .ring-item i {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .ring-item span {
        font-size: 11px;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .ring-center {
        width: 140px;
        height: 140px;
        padding: 1rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .center-logo i {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .center-logo h3 {
        font-size: 14px;
        margin: 5px 0;
        letter-spacing: 0.5px;
    }
    
    .center-logo p {
        font-size: 10px;
        opacity: 0.9;
    }
    
    /* Rotating circle for mobile */
    .ring-items::before {
        width: 360px;
        height: 360px;
        border-width: 3px;
    }
    
    /* Better radius for mobile touch targets */
    .ring-item:nth-child(1) { 
        transform: translate(-50%, -50%) rotate(0deg) translateX(165px) rotate(0deg);
    }
    .ring-item:nth-child(2) { 
        transform: translate(-50%, -50%) rotate(51.43deg) translateX(165px) rotate(-51.43deg);
    }
    .ring-item:nth-child(3) { 
        transform: translate(-50%, -50%) rotate(102.86deg) translateX(165px) rotate(-102.86deg);
    }
    .ring-item:nth-child(4) { 
        transform: translate(-50%, -50%) rotate(154.29deg) translateX(165px) rotate(-154.29deg);
    }
    .ring-item:nth-child(5) { 
        transform: translate(-50%, -50%) rotate(205.71deg) translateX(165px) rotate(-205.71deg);
    }
    .ring-item:nth-child(6) { 
        transform: translate(-50%, -50%) rotate(257.14deg) translateX(165px) rotate(-257.14deg);
    }
    .ring-item:nth-child(7) { 
        transform: translate(-50%, -50%) rotate(308.57deg) translateX(165px) rotate(-308.57deg);
    }
    
    /* Mobile Panel */
    .proxy-detail-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100vh - 85px);
        border-left: none;
        border-radius: 0;
        position: fixed;
        top: 85px;
        left: 100vw;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        padding-top: 0;
        background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(15, 15, 35, 0.98) 100%);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
        z-index: 1001;
        transform: translateX(0);
        transition: transform 0.3s ease-out;
    }
    
    .proxy-detail-panel.active {
        transform: translateX(-100vw) !important;
        left: 100vw !important;
    }
    
    .detail-header {
        padding: 45px 20px 30px;
        padding-top: calc(45px + env(safe-area-inset-top));
        margin-top: 0;
        text-align: center;
        position: relative;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
        overflow: visible;
        min-height: 140px;
    }
    
    .detail-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
        pointer-events: none;
    }
    
    .detail-header h2 {
        font-size: 24px;
        margin: 20px 0 12px;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
        position: relative;
        z-index: 2;
    }
    
    .detail-header p {
        font-size: 15px;
        opacity: 0.95;
        margin-bottom: 10px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        line-height: 1.4;
        position: relative;
        z-index: 2;
        padding: 0 10px;
    }
    
    .detail-close {
        position: absolute;
        top: 12px !important;
        right: 10px !important;
        width: 20px !important;
        height: 20px !important;
        z-index: 1002;
        font-size: 10px !important;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }
    
    .detail-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }
    
    .detail-content {
        padding: 20px;
        background: rgba(0, 0, 0, 0.1);
    }
    
    .setup-section {
        margin-bottom: 18px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        padding: 16px;
        border: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    .setup-section h4 {
        font-size: 14px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #a78bfa;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .setup-section h4 i {
        font-size: 16px;
        filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
    }
    
    .url-box {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        background: rgba(30, 30, 50, 0.9);
        border-radius: 10px;
        border: 2px solid rgba(102, 126, 234, 0.4);
        margin: 15px 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    .url-box code {
        white-space: nowrap;
        overflow-x: auto;
        font-size: 13px;
        padding: 14px;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 8px;
        display: block;
        color: #a78bfa;
        line-height: 1.5;
        font-family: 'Courier New', monospace;
        border: 1px solid rgba(167, 139, 250, 0.3);
        scrollbar-width: thin;
        scrollbar-color: rgba(167, 139, 250, 0.5) rgba(0, 0, 0, 0.1);
    }
    
    .copy-url-btn {
        width: 100%;
        justify-content: center;
        padding: 16px;
        font-size: 15px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: white;
        border-radius: 8px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        min-height: 48px;
        transition: all 0.3s ease;
    }
    
    .copy-url-btn:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    }
    
    .model-tags {
        gap: 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin: 16px 0;
    }
    
    .model-tag {
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .setup-steps {
        margin: 10px 0;
        padding: 0;
        list-style: none;
    }
    
    .setup-steps li {
        margin: 0 0 8px 0;
        padding: 8px 10px;
        gap: 8px;
        border: 1px solid rgba(102, 126, 234, 0.25);
        background: rgba(255, 255, 255, 0.02);
        border-radius: 6px;
        position: relative;
        display: flex;
        align-items: center;
        min-height: auto;
        line-height: 1.3;
    }
    
    .setup-steps li:last-child {
        border-bottom: 1px solid rgba(102, 126, 234, 0.25);
    }
    
    .step-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    }
    
    .step-text {
        font-size: 13px;
        line-height: 1.3;
        color: #e0e0e0;
        font-weight: 400;
        flex: 1;
        margin: 0;
        padding: 0;
    }
    
    .tip-text {
        font-size: 13px;
        padding: 10px 12px;
        line-height: 1.4;
        background: rgba(16, 185, 129, 0.15);
        border-left: 4px solid #10b981;
        border-radius: 6px;
        color: #6ee7b7;
        margin: 8px 0;
        box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
    }
    
    /* NEW Badge adjustment */
    .ring-item.mistral .new-badge {
        width: 30px;
        height: 30px;
        top: 3px;
        right: 3px;
    }
    
    /* Mobile badge sizing */
    .ring-item.mistral .new-badge {
        font-size: 3.8px !important;
        letter-spacing: 0.1px !important;
    }
    
    /* Connections for mobile */
    .ring-connection {
        width: 140px;
    }
    
    /* ToS Notice for mobile */
    .tos-notice {
        padding: 1rem;
        margin: 1.5rem 1rem;
        font-size: 12px;
        background: rgba(138, 43, 226, 0.05);
        border: 1px solid rgba(138, 43, 226, 0.2);
        border-radius: 10px;
        backdrop-filter: blur(10px);
    }
    
    .tos-notice p {
        font-size: 12px;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.8);
    }
    
    .tos-notice i {
        font-size: 16px;
        color: rgba(138, 43, 226, 0.8);
    }
    
    .tos-notice a {
        color: #a78bfa;
        font-weight: 600;
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: all 0.3s ease;
    }
    
    .tos-notice a:hover {
        color: #c084fc;
        border-bottom-color: #c084fc;
    }
}

/* Landscape Mode Adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .proxy-detail-panel {
        top: 70px !important;
        height: calc(100vh - 70px) !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Safe margin for all mobile devices */
@media (max-width: 768px) {
    /* Ensure panel always starts below header and uses full width */
    .proxy-detail-panel {
        min-top: 80px;
        width: 100vw !important;
        max-width: 100vw !important;
        position: fixed !important;
        left: 100vw !important;
        right: auto !important;
    }
    
    .proxy-detail-panel.active {
        transform: translateX(-100vw) !important;
    }
    
    /* Make close button more prominent */
    .detail-close:active {
        background: rgba(255, 255, 255, 0.5) !important;
        transform: scale(0.95);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    /* Proxy Panel for very small screens */
    .proxy-detail-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        top: 75px !important;
        height: calc(100vh - 75px) !important;
        border-left: none !important;
        position: fixed !important;
        left: 100vw !important;
        right: auto !important;
    }
    
    .proxy-detail-panel.active {
        transform: translateX(-100vw) !important;
        left: 100vw !important;
    }
    
    .detail-header {
        padding: 40px 15px 25px !important;
    }
    
    .detail-header h2 {
        font-size: 20px !important;
        margin-top: 15px !important;
    }
    
    .detail-header p {
        font-size: 13px !important;
        margin-bottom: 15px !important;
    }
    
    .detail-content {
        padding: 15px !important;
    }
    
    .server-ring-menu {
        height: 420px;
        margin: -2rem auto 1.5rem !important;
        margin-top: -2rem !important;
        padding: 1rem;
    }
    
    .ring-item {
        width: 75px;
        height: 75px;
    }
    
    .ring-item i {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .ring-item span {
        font-size: 10px;
    }
    
    .ring-center {
        width: 110px;
        height: 110px;
    }
    
    .center-logo i {
        font-size: 26px;
    }
    
    .center-logo h3 {
        font-size: 12px;
    }
    
    .center-logo p {
        font-size: 9px;
    }
    
    /* Even more compact detail panel */
    .detail-header {
        padding: 12px;
        padding-top: 15px;
        text-align: center;
    }
    
    .detail-header {
        padding: 25px 15px 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
        overflow: hidden;
    }
    
    .detail-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
        pointer-events: none;
    }
    
    .detail-header h2 {
        font-size: 20px;
        margin: 12px 0 8px;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
        position: relative;
        z-index: 2;
    }
    
    .detail-header p {
        font-size: 13px;
        opacity: 0.95;
        margin-bottom: 5px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        line-height: 1.4;
        position: relative;
        z-index: 2;
    }
    
    .detail-close {
        position: absolute;
        top: 10px !important;
        right: 8px !important;
        width: 18px !important;
        height: 18px !important;
        z-index: 1001;
        font-size: 9px !important;
        background: rgba(255, 255, 255, 0.18);
        border: 0.5px solid rgba(255, 255, 255, 0.25);
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .detail-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }
    
    .detail-content {
        padding: 12px;
    }
    
    .setup-section {
        margin-bottom: 4px;
    }
    
    .setup-section h4 {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .url-box {
        padding: 10px;
        gap: 8px;
    }
    
    .url-box code {
        font-size: 10px;
        padding: 8px;
        color: #c0a0ff;
    }
    
    .copy-url-btn {
        padding: 10px;
        font-size: 11px;
        min-height: 36px;
    }
    
    .setup-steps li {
        padding: 6px 8px;
        margin: 0 0 6px 0;
        border: 1px solid rgba(102, 126, 234, 0.2);
        background: rgba(255, 255, 255, 0.02);
        border-radius: 4px;
        align-items: center;
        min-height: auto;
        line-height: 1.2;
        display: flex;
        position: relative;
        gap: 6px;
    }
    
    .setup-steps li:last-child {
        border-bottom: none;
    }
    
    .step-number {
        width: 16px;
        height: 16px;
        font-size: 9px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-weight: 600;
    }
    
    .step-text {
        font-size: 11px;
        line-height: 1.2;
        flex: 1;
        margin: 0;
        padding: 0;
    }
    
    .model-tag {
        font-size: 9px;
        padding: 4px 6px;
    }
    
    .tip-text {
        font-size: 11px;
        padding: 8px;
        margin: 6px 0;
    }
    
    .ring-item {
        width: 60px;
        height: 60px;
    }
    
    .ring-item i {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .ring-item span {
        font-size: 8px;
    }
    
    .ring-center {
        width: 100px;
        height: 100px;
        padding: 0.6rem;
    }
    
    .center-logo i {
        font-size: 24px;
        margin-bottom: 3px;
    }
    
    .center-logo h3 {
        font-size: 10px;
        margin: 2px 0;
    }
    
    .center-logo p {
        font-size: 8px;
    }
    
    /* Smaller rotating circle */
    .ring-items::before {
        width: 280px;
        height: 280px;
    }
    
    /* Even smaller radius for small phones */
    .ring-item:nth-child(1) { 
        transform: translate(-50%, -50%) rotate(0deg) translateX(130px) rotate(0deg);
    }
    .ring-item:nth-child(2) { 
        transform: translate(-50%, -50%) rotate(51.43deg) translateX(130px) rotate(-51.43deg);
    }
    .ring-item:nth-child(3) { 
        transform: translate(-50%, -50%) rotate(102.86deg) translateX(130px) rotate(-102.86deg);
    }
    .ring-item:nth-child(4) { 
        transform: translate(-50%, -50%) rotate(154.29deg) translateX(130px) rotate(-154.29deg);
    }
    .ring-item:nth-child(5) { 
        transform: translate(-50%, -50%) rotate(205.71deg) translateX(130px) rotate(-205.71deg);
    }
    .ring-item:nth-child(6) { 
        transform: translate(-50%, -50%) rotate(257.14deg) translateX(130px) rotate(-257.14deg);
    }
    .ring-item:nth-child(7) { 
        transform: translate(-50%, -50%) rotate(308.57deg) translateX(130px) rotate(-308.57deg);
    }
    
    /* Adjust NEW badge for small mobile */
    .ring-item.mistral .new-badge {
        width: 27px;
        height: 27px;
        top: 2px;
        right: 2px;
    }
    
    /* Small mobile badge sizing */
    .ring-item.mistral .new-badge {
        font-size: 3.2px !important;
        letter-spacing: 0.05px !important;
    }
    
    /* Connections for small mobile */
    .ring-connection {
        width: 120px;
    }
    
    /* Rotating dashed circle */
    .rotating-circle {
        width: 280px;
        height: 280px;
    }
    
    /* ToS Notice for small mobile */
    .tos-notice {
        padding: 0.7rem;
        margin: 0.8rem 0.3rem;
    }
    
    .tos-notice p {
        font-size: 10px;
    }
}

/* Very Small Mobile (SE, Mini) */
@media (max-width: 375px) {
    .server-ring-menu {
        height: 380px;
    }
    
    .ring-item {
        width: 55px;
        height: 55px;
    }
    
    .ring-item i {
        font-size: 18px;
    }
    
    .ring-item span {
        font-size: 7px;
    }
    
    .ring-center {
        width: 90px;
        height: 90px;
        padding: 0.5rem;
    }
    
    .center-logo i {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .center-logo h3 {
        font-size: 9px;
    }
    
    .center-logo p {
        font-size: 7px;
    }
    
    /* Even smaller rotating circle */
    .ring-items::before {
        width: 260px;
        height: 260px;
    }
    
    /* Minimal radius for very small screens */
    .ring-item:nth-child(1) { 
        transform: translate(-50%, -50%) rotate(0deg) translateX(120px) rotate(0deg);
    }
    .ring-item:nth-child(2) { 
        transform: translate(-50%, -50%) rotate(51.43deg) translateX(120px) rotate(-51.43deg);
    }
    .ring-item:nth-child(3) { 
        transform: translate(-50%, -50%) rotate(102.86deg) translateX(120px) rotate(-102.86deg);
    }
    .ring-item:nth-child(4) { 
        transform: translate(-50%, -50%) rotate(154.29deg) translateX(120px) rotate(-154.29deg);
    }
    .ring-item:nth-child(5) { 
        transform: translate(-50%, -50%) rotate(205.71deg) translateX(120px) rotate(-205.71deg);
    }
    .ring-item:nth-child(6) { 
        transform: translate(-50%, -50%) rotate(257.14deg) translateX(120px) rotate(-257.14deg);
    }
    .ring-item:nth-child(7) { 
        transform: translate(-50%, -50%) rotate(308.57deg) translateX(120px) rotate(-308.57deg);
    }
    
    .rotating-circle {
        width: 260px;
        height: 260px;
    }
}

/* Setup Steps Styling */
.setup-steps {
    list-style: none;
    padding: 0;
    margin: 5px 0;
}

.setup-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 2px 10px 2px 30px;
    background: transparent;
    border: none;
    position: relative;
    transition: all 0.3s ease;
    height: 20px;
    line-height: 1;
}

.setup-steps li:last-child {
    border-bottom: none;
}

.step-number {
    position: absolute;
    left: 8px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 9px;
    flex-shrink: 0;
}

.step-text {
    color: #e0e0e0;
    font-size: 12px;
    line-height: 1.3;
    flex: 1;
    margin: 0;
    padding: 0;
    font-weight: 400;
}

.tip-text {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    padding: 15px;
    border-radius: 8px;
    color: #a0f0d0;
    font-size: 14px;
    line-height: 1.6;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

