/* ============================================
   Instagram — Simple Clean Dark Reskin
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #f1f1f1;
    min-height: 100vh;
}

.hidden { display: none !important; }

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: #0a0a0f;
    z-index: 10;
}

.back-btn, .menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #141419;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    transition: all 180ms ease;
    text-decoration: none;
}

.back-btn:hover, .menu-btn:hover {
    background: #1a1a21;
    color: #f1f1f1;
    border-color: rgba(255,255,255,0.1);
}

.topbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #888;
}

/* Input Area */
.input-area { margin-bottom: 20px; }

.input-box {
    background: #141419;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 6px;
    transition: border-color 180ms ease;
}

.input-box:focus-within {
    border-color: rgba(228,64,95,0.3);
}

.input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px 6px 14px;
}

.username-input {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f1f1;
    font-size: 0.9375rem;
    font-family: inherit;
    flex: 1;
    width: 100%;
}

.username-input::placeholder { color: #555; }

.connect-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 180ms ease;
    background: #1a1a21;
    color: #555;
    font-family: inherit;
    white-space: nowrap;
}

.connect-btn.active {
    background: linear-gradient(135deg, #ea4c89, #f77737);
    color: #fff;
}

.connect-btn.active:hover { opacity: 0.9; }

.connecting {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    padding: 10px;
    color: #888;
    font-size: 0.875rem;
}

.spinner {
    animation: spin 1s linear infinite;
    color: #ea4c89;
}

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

.connected {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 0.875rem;
    color: #f1f1f1;
}

.change-btn {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 180ms ease;
    white-space: nowrap;
}

.change-btn:hover {
    color: #888;
    background: #1a1a21;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #141419;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: all 180ms ease;
    text-align: left;
    width: 100%;
    color: inherit;
}

.feature:hover:not(.disabled) {
    background: #1a1a21;
    border-color: rgba(228,64,95,0.2);
    transform: translateY(-1px);
}

.feature:hover:not(.disabled) .feature-chevron {
    color: #666;
    transform: translateX(2px);
}

.feature:active:not(.disabled) { transform: scale(0.99); }

.feature.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(228,64,95,0.08);
    border: 1px solid rgba(228,64,95,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4405f;
    flex-shrink: 0;
    transition: transform 180ms ease;
}

.feature:hover .feature-icon { transform: scale(1.05); }

.feature-icon svg { width: 20px; height: 20px; }

.feature-text { flex: 1; min-width: 0; }

.feature-text h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f1f1f1;
    margin-bottom: 2px;
}

.feature-text p {
    font-size: 0.8125rem;
    color: #555;
    line-height: 1.4;
}

.feature-chevron {
    color: #333;
    flex-shrink: 0;
    transition: all 180ms ease;
}

/* Popup Modal */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.popup-box {
    background: #141419;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}

.popup-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.popup-label {
    font-size: 0.875rem;
    color: #888;
}

.popup-label span { color: #ea4c89; font-weight: 600; }

.popup-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #1a1a21;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms ease;
}

.popup-close:hover {
    background: #22222a;
    color: #888;
}

.popup-bar-bg {
    height: 8px;
    background: #1a1a21;
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.popup-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ea4c89, #f77737);
    border-radius: 9999px;
    transition: width 0.1s linear;
    width: 0%;
}

.popup-percent {
    text-align: center;
    color: #ea4c89;
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 12px;
}

/* Focus */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid #ea4c89;
    outline-offset: 2px;
}

@media (max-width: 380px) {
    .app { padding: 0 16px 32px; }
    .feature { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
