/* 🌐 Internet Module v3.0 — Chrome-like in-app browser */

.int-browser {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 80px);
    min-height: 520px;
    background: var(--radim-surface-sunken);
    color: var(--radim-text);
    font-family: inherit;
}

/* ── Tabs bar ────────────────────────────────────────────────── */
.int-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 8px 12px 0;
    background: #eef2f5;
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 38px;
}

.int-tabs:empty { padding: 0; min-height: 0; }

.int-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    background: #d7dee3;
    border-radius: var(--radim-radius-sm) 10px 0 0;
    cursor: pointer;
    min-width: 140px;
    max-width: 220px;
    font-size: 0.88rem;
    color: var(--radim-text-muted);
    transition: background 0.15s;
}

.int-tab:hover { background: var(--radim-border-strong); }

.int-tab-active {
    background: var(--radim-surface);
    color: var(--radim-text);
    font-weight: 600;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06);
}

.int-tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.int-tab-close {
    background: transparent;
    border: none;
    color: var(--radim-text-subtle);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.int-tab-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--radim-text);
}

.int-tab-new {
    background: transparent;
    border: none;
    color: var(--radim-text-muted);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    border-radius: 50%;
    cursor: pointer;
    align-self: center;
}

.int-tab-new:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ── Chrome bar (back/forward/reload/home + URL) ─────────────── */
.int-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--radim-surface);
    border-bottom: 1px solid var(--radim-border);
    flex-shrink: 0;
}

.int-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--radim-text-muted);
    font-size: 1.1rem;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}

.int-icon-btn:hover:not(:disabled) {
    background: var(--radim-primary-tint);
    color: var(--radim-text);
}

.int-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.int-url {
    flex: 1;
    padding: 9px 16px;
    font-size: 0.95rem;
    border: 1.5px solid var(--radim-border);
    border-radius: var(--radim-radius-2xl);
    background: var(--radim-surface-sunken);
    color: var(--radim-text);
    outline: none;
    margin: 0 6px;
    font-family: inherit;
}

.int-url:focus {
    border-color: var(--radim-primary);
    background: var(--radim-surface);
}

/* ── Viewport (where pages render) ───────────────────────────── */
.int-viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--radim-surface);
    overflow: hidden;
}

.int-frame-shell {
    position: relative;
    width: 100%;
    height: 100%;
}

.int-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--radim-surface);
}

.int-frame-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--radim-surface-sunken);
    color: var(--radim-text-subtle);
    font-size: 1rem;
    pointer-events: none;
}

.int-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--radim-primary-ring);
    border-top-color: var(--radim-primary);
    border-radius: 50%;
    animation: int-spin 0.8s linear infinite;
}

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

/* ── Home (rendered inside viewport) ─────────────────────────── */
.int-home {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.int-home-header {
    margin-bottom: 20px;
    text-align: center;
}

.int-home-header h2 {
    font-size: 1.5rem;
    color: var(--radim-text);
    margin: 0 0 6px;
    font-weight: 700;
}

.int-home-subtitle {
    color: var(--radim-text-subtle);
    font-size: 1rem;
    margin: 0;
}

.int-categories {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.int-category {
    background: var(--radim-surface-sunken);
    border: 1px solid var(--radim-border);
    border-radius: var(--radim-radius-xl);
    padding: 14px 14px 12px;
}

.int-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--radim-text);
}

.int-category-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.int-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.int-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--radim-surface);
    border: 1.5px solid var(--radim-border);
    border-radius: var(--radim-radius-md);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    text-align: center;
    font-family: inherit;
}

.int-shortcut:hover {
    border-color: var(--radim-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--radim-primary-ring);
}

.int-shortcut-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--radim-text);
    margin-bottom: 2px;
}

.int-shortcut-domain {
    font-size: 0.76rem;
    color: var(--radim-text-faded);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .int-browser {
        height: calc(100vh - 70px);
    }
    .int-chrome {
        padding: 8px 10px;
        gap: 4px;
    }
    .int-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    .int-url {
        padding: 7px 12px;
        font-size: 0.9rem;
    }
    .int-home {
        padding: 16px 12px 32px;
    }
    .int-shortcuts {
        grid-template-columns: 1fr;
    }
}
